From 03fd138b633374b0df3385785bb530b23b2d2255 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 7 Sep 2018 15:23:10 +0530 Subject: [PATCH] Linux: Fix crash with some nvidia drivers when creating tabs in the first top level-window after creating a second top-level window. Fixes #873 The wrong window's OpenGL context was current when creating the tabs. --- docs/changelog.rst | 3 +++ kitty/state.c | 1 + 2 files changed, 4 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 7b39358b8..1fec97b91 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -38,6 +38,9 @@ Changelog - Linux: Fix XCompose rules with no defined symbol not working (:iss:`880`) +- Linux: Fix crash with some nvidia drivers when creating tabs in the first + top level-window after creating a second top-level window. (:iss:`873`) + 0.12.0 [2018-09-01] ------------------------------ diff --git a/kitty/state.c b/kitty/state.c index 5891be760..ffb157e33 100644 --- a/kitty/state.c +++ b/kitty/state.c @@ -90,6 +90,7 @@ add_os_window() { static inline id_type add_tab(id_type os_window_id) { WITH_OS_WINDOW(os_window_id) + make_os_window_context_current(os_window); ensure_space_for(os_window, tabs, Tab, os_window->num_tabs + 1, capacity, 1, true); memset(os_window->tabs + os_window->num_tabs, 0, sizeof(Tab)); os_window->tabs[os_window->num_tabs].id = ++global_state.tab_id_counter;