patch 9.2.0709: GTK4: a few minor issues
Commit:
https://github.com/vim/vim/commit/2fd83d0ddcaa2120dfc5fe5e7746c7c5e73db92a
Author: Foxe Chen <
chen...@gmail.com>
Date: Tue Jun 23 19:51:54 2026 +0000
patch 9.2.0709: GTK4: a few minor issues
Problem: GTK4: a few minor issues
Solution: Update docs for 'mouseshape' option, remove unnecessary code,
respect "v" flag in 'guioptions' (Foxe Chen)
closes: #20609
Signed-off-by: Foxe Chen <
chen...@gmail.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 9743dea43..7339133c6 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 9.2. Last change: 2026 Jun 17
+*options.txt* For Vim version 9.2. Last change: 2026 Jun 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -6458,7 +6458,7 @@ A jump table for the options with a short description can be found at |Q_op|.
x <number> any X11 pointer number (see X11/cursorfont.h)
The "avail" column contains a 'w' if the shape is available for Win32,
- x for X11 (including GTK+ 2), g for GTK+ 3.
+ x for X11 (including GTK+ 2), g for GTK+ 3 and GTK 4.
Any modes not specified or shapes not available use the normal mouse
pointer.
diff --git a/src/gui_gtk4.c b/src/gui_gtk4.c
index bcadb31a5..5126f9919 100644
--- a/src/gui_gtk4.c
+++ b/src/gui_gtk4.c
@@ -2217,8 +2217,9 @@ motion_notify_event(GtkEventControllerMotion *controller UNUSED,
// Only unhide if mouse actually moved. GTK seems to send a motion event
// when switching tabs, causing the cursor to unhide.
- if (p_mh && fabs(prev_mouse_x - x) > 0.05
- && fabs(prev_mouse_y - y) > 0.05)
+ if (p_mh && ((prev_mouse_x == -1 || prev_mouse_y == -1)
+ || (fabs(prev_mouse_x - x) > 0.05
+ && fabs(prev_mouse_y - y) > 0.05)))
gui_mch_mousehide(FALSE);
prev_mouse_x = x;
@@ -4362,17 +4363,9 @@ mch_set_mouse_shape(int shape)
last_shape = shape;
}
-#else // !FEAT_MOUSESHAPE
-
- void
-mch_set_mouse_shape(int shape UNUSED)
-{
-}
-
#endif // FEAT_MOUSESHAPE
-
/*
* Menus, scrollbars, dialogs, toolbar.
* (merged from gui_gtk4.c)
@@ -5362,10 +5355,16 @@ gui_mch_dialog(
if (buttons != NULL)
{
- GtkWidget *but_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
+ GtkWidget *but_box;
char **buttons_arr; // Note that array is allocated, not strings
int n_buttons;
+ // Check 'v' flag in 'guioptions': vertical button placement.
+ if (vim_strchr(p_go, GO_VERTICAL) != NULL)
+ but_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 8);
+ else
+ but_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
+
gtk_widget_set_halign(but_box, GTK_ALIGN_CENTER);
gtk_box_set_homogeneous(GTK_BOX(but_box), TRUE);
gtk_box_append(GTK_BOX(vertbox), but_box);
diff --git a/src/version.c b/src/version.c
index 753a36d2d..3f52cbadf 100644
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 709,
/**/
708,
/**/