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.
This commit is contained in:
Kovid Goyal 2018-09-07 15:23:10 +05:30
parent 1eeaef6dbb
commit 03fd138b63
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 0 deletions

View File

@ -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]
------------------------------

View File

@ -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;