mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
window: reset both press/drag gestures when move/resize drag starts
Now that this is split in two separate gestures, both must be reset when the WM grabs the pointer. Also, do on resize drags like on move drags, and claim the gesture before resetting, so the ownership is properly transferred across any other widgets. https://bugzilla.gnome.org/show_bug.cgi?id=745969
This commit is contained in:
parent
2f8938cf23
commit
622a930c5a
@ -1487,6 +1487,8 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
|
||||
{
|
||||
gdouble x_root, y_root;
|
||||
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
|
||||
gdk_event_get_root_coords (event, &x_root, &y_root);
|
||||
gdk_window_begin_resize_drag_for_device (gtk_widget_get_window (widget),
|
||||
(GdkWindowEdge) region,
|
||||
@ -1494,6 +1496,9 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
|
||||
GDK_BUTTON_PRIMARY,
|
||||
x_root, y_root,
|
||||
gdk_event_get_time (event));
|
||||
|
||||
gtk_event_controller_reset (GTK_EVENT_CONTROLLER (gesture));
|
||||
gtk_event_controller_reset (GTK_EVENT_CONTROLLER (priv->drag_gesture));
|
||||
}
|
||||
|
||||
break;
|
||||
@ -1528,6 +1533,7 @@ drag_gesture_update_cb (GtkGestureDrag *gesture,
|
||||
gdouble offset_y,
|
||||
GtkWindow *window)
|
||||
{
|
||||
GtkWindowPrivate *priv = window->priv;
|
||||
gint double_click_distance;
|
||||
GtkSettings *settings;
|
||||
|
||||
@ -1579,6 +1585,7 @@ drag_gesture_update_cb (GtkGestureDrag *gesture,
|
||||
gtk_get_current_event_time ());
|
||||
|
||||
gtk_event_controller_reset (GTK_EVENT_CONTROLLER (gesture));
|
||||
gtk_event_controller_reset (GTK_EVENT_CONTROLLER (priv->multipress_gesture));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user