[gtk/grab-cursor-fix] window: Prevent resize cursors from sticking



commit 26b17473aac0178a8df82bf9f5f8796216aa1080
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed May 1 00:16:21 2019 +0000

    window: Prevent resize cursors from sticking
    
    When a modal dialog is smaller than its parent,
    we were keeping the resize cursor from the dialogs
    edge all over the parent window, which looks
    really irritating, since the resize cursors are
    closely associated with the window edge. Fix
    this by falling back to the default cursor
    outside the grab widgets surface.
    
    Closes: https://gitlab.gnome.org/GNOME/gtk/issues/23

 gtk/gtkwindow.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 04c1decdfb..bdff204913 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -9885,7 +9885,10 @@ update_cursor (GtkWindow *toplevel,
       /* Outside the grab widget, cursor stays to whatever the grab
        * widget says.
        */
-      cursor = gtk_widget_get_cursor (grab_widget);
+      if (gtk_widget_get_surface (grab_widget) == gtk_widget_get_surface (target))
+        cursor = gtk_widget_get_cursor (grab_widget);
+      else
+        cursor = NULL;
     }
   else
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]