]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0709: GTK4: a few minor issues v9.2.0709
authorFoxe Chen <chen.foxe@gmail.com>
Tue, 23 Jun 2026 19:51:54 +0000 (19:51 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 23 Jun 2026 19:51:54 +0000 (19:51 +0000)
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.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/options.txt
src/gui_gtk4.c
src/version.c

index 9743dea438cd61ac1de392943624d155499b7b00..7339133c6db4ddc31e1d41a8ad0589b57bcd4854 100644 (file)
@@ -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.
 
index bcadb31a56123968eed2723901c3b793c0875c11..5126f991989a5fef637e51796cd69f372a4fb8f4 100644 (file)
@@ -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);
index 753a36d2de375f69af3a7179babbfbd81186aaf6..3f52cbadff20e00b1a6b0d8e699c82af4b3bc3d1 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    709,
 /**/
     708,
 /**/