[gtk+] window: Only claim a button=1 press sequence when dragging is about to happen



commit 3ef1b387bcee52a2d85be1a9ef2cbc6a3a813293
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jun 12 14:15:26 2014 +0200

    window: Only claim a button=1 press sequence when dragging is about to happen
    
    This way plain clicks can be handled in gtkmain through the usual delivery mechanism,
    and get possibly handled too by widgets holding a GTK+ grab. If window dragging is to
    be started, the sequence will be claimed (and a grab will happen afterwards), notifying
    properly the grabbing widget that event delivery was interrupted.
    
    This makes it possible to dismiss popovers by clicking on window headerbars, while
    still making it possible to drag the window with the popover opened.

 gtk/gtkwindow.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 39d3a68..f8e71fc 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1454,9 +1454,6 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
 
       break;
     }
-
-  gtk_gesture_set_sequence_state (GTK_GESTURE (gesture),
-                                  sequence, GTK_EVENT_SEQUENCE_CLAIMED);
 }
 
 static void
@@ -1483,6 +1480,8 @@ multipress_gesture_stopped_cb (GtkGestureMultiPress *gesture,
     {
       gdouble x_root, y_root;
 
+      gtk_gesture_set_sequence_state (GTK_GESTURE (gesture),
+                                      sequence, GTK_EVENT_SEQUENCE_CLAIMED);
       gdk_event_get_root_coords (event, &x_root, &y_root);
       gdk_window_begin_move_drag_for_device (gtk_widget_get_window (GTK_WIDGET (window)),
                                              gdk_event_get_device ((GdkEvent*) event),


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