patch 9.2.0563: GTK3/Wayland: crash with right mouse-button in tabline
Commit:
https://github.com/vim/vim/commit/92510c09ed58911e019d09ac149e546dae6cdda9
Author: Christoffer Aasted <[email protected]>
Date: Fri May 29 19:39:04 2026 +0000
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 <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 44b95345f..8b57eef08 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 1dcca61ea..91ca23617 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 179b90e70..d3977ad1f 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,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1wT38i-00D9ck-CC%40256bit.org.