[gtk+] x11: Avoid crash in fallback move emulation



commit 61843d60b2543d4a3f25e2eaa25cb50bde5cfa4e
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Dec 15 16:17:27 2017 -0500

    x11: Avoid crash in fallback move emulation
    
    Quietly do nothing when there is already an ongoing operation.
    This matches the behavior of the ewmh code, and is much nicer
    than a crash.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789054

 gdk/x11/gdkwindow-x11.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index baa26cc..f2e23df 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -4534,6 +4534,9 @@ emulate_resize_drag (GdkWindow     *window,
 {
   MoveResizeData *mv_resize = get_move_resize_data (GDK_WINDOW_DISPLAY (window), TRUE);
 
+  if (mv_resize->moveresize_window != NULL)
+    return; /* already a drag operation in progress */
+
   mv_resize->is_resize = TRUE;
   mv_resize->moveresize_button = button;
   mv_resize->resize_edge = edge;
@@ -4564,7 +4567,10 @@ emulate_move_drag (GdkWindow     *window,
                    guint32        timestamp)
 {
   MoveResizeData *mv_resize = get_move_resize_data (GDK_WINDOW_DISPLAY (window), TRUE);
-  
+
+  if (mv_resize->moveresize_window != NULL)
+    return; /* already a drag operation in progress */
+
   mv_resize->is_resize = FALSE;
   mv_resize->device = device;
   mv_resize->moveresize_button = button;


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