]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0563: GTK3/Wayland: crash with right mouse-button in tabline v9.2.0563
authorChristoffer Aasted <dezzadk@gmail.com>
Fri, 29 May 2026 19:39:04 +0000 (19:39 +0000)
committerChristian Brabandt <cb@256bit.org>
Fri, 29 May 2026 19:39:04 +0000 (19:39 +0000)
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 <dezzadk@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/gui_gtk_x11.c
src/testdir/test_codestyle.vim
src/version.c

index 44b95345fe74c40af12c850528f533c90e835bbb..8b57eef0888bdd3e75f171a92ad96e1de466215f 100644 (file)
@@ -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,
index 1dcca61eabd30af834319431f745c4abf6f5b67d..91ca23617771cf29715b9216f6ae1701dce38f85 100644 (file)
@@ -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.
index 179b90e7007a67d8bdf5925d93371374f32b70eb..d3977ad1ffb47e346b9f452ac8a809d0fd55f9da 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    563,
 /**/
     562,
 /**/