From: Christoffer Aasted Date: Fri, 29 May 2026 19:39:04 +0000 (+0000) Subject: patch 9.2.0563: GTK3/Wayland: crash with right mouse-button in tabline X-Git-Tag: v9.2.0563^0 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=92510c09ed58911e019d09ac149e546dae6cdda9;p=thirdparty%2Fvim.git patch 9.2.0563: GTK3/Wayland: crash with right mouse-button in tabline Problem: GTK3/Wayland: crash with right mouse-button in tabline Solution: Use gui.mainwin and get coordinates (Christoffer Aasted). GtkNotebook (tabline) is a windowless container widget causing a nullptr deref inside `gdk_window_get_effective_parent()` as Wayland lacks a surface to anchor to. fixes: #18864 closes: #20348 Signed-off-by: Christoffer Aasted Signed-off-by: Christian Brabandt --- diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 44b95345fe..8b57eef088 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -3435,6 +3435,17 @@ on_tabline_menu(GtkWidget *widget, GdkEvent *event) if (bevent->button == 3) { # if GTK_CHECK_VERSION(3,22,2) +# ifdef GDK_WINDOWING_WAYLAND + if (gui.is_wayland) + { + int x2, y2; + gui_gtk_get_pointer(gui.mainwin, &x2, &y2, NULL); + gtk_menu_popup_at_rect(GTK_MENU(widget), + gtk_widget_get_window(gui.mainwin), &(GdkRectangle){x2, y2, 1, 1}, + GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, NULL); + } + else +# endif gtk_menu_popup_at_pointer(GTK_MENU(widget), event); # else gtk_menu_popup(GTK_MENU(widget), NULL, NULL, NULL, NULL, diff --git a/src/testdir/test_codestyle.vim b/src/testdir/test_codestyle.vim index 1dcca61eab..91ca236177 100644 --- a/src/testdir/test_codestyle.vim +++ b/src/testdir/test_codestyle.vim @@ -50,7 +50,17 @@ def Test_source_files() continue endif - var skip = 'getline(".") =~ "condition) {" || getline(".") =~ "vimglob_func" || getline(".") =~ "{\"" || getline(".") =~ "{\\d" || getline(".") =~ "{{{"' + # ignore patterns: + # - condition) { + # - vimglob_func + # - struct initializer: {" + # - numeric initializer: {\d + # - fold marker {{{ + # - compound literals: (\w\+) *{ + + + var skip = 'getline(".") =~ "condition) {" || getline(".") =~ "vimglob_func" || getline(".") =~ "{\"" ||' + skip ..= ' getline(".") =~ "{\\d" || getline(".") =~ "{{{" || getline(".") =~ "(\\w\\+) *{"' PerformCheck(fname, ')\s*{', 'curly after closing paren', skip) # Examples in comments use double quotes. diff --git a/src/version.c b/src/version.c index 179b90e700..d3977ad1ff 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 563, /**/ 562, /**/