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.
This commit is contained in:
Carlos Garnacho 2014-06-12 14:15:26 +02:00
parent 5b118a9fd7
commit 3ef1b387bc

View File

@ -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),