summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2014-06-12 14:15:26 +0200
committerCarlos Garnacho <carlosg@gnome.org>2014-06-12 14:27:35 +0200
commit3ef1b387bcee52a2d85be1a9ef2cbc6a3a813293 (patch)
tree01097a4ad0f0b1d8a805611cf6239216fdcd8796
parent5b118a9fd768f752f3e770d7734596e239de942d (diff)
downloadgtk+-3ef1b387bcee52a2d85be1a9ef2cbc6a3a813293.tar.gz
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.
-rw-r--r--gtk/gtkwindow.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 39d3a68cd9..f8e71fcc46 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),