[gtk+] window: reset both press/drag gestures when move/resize drag starts
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] window: reset both press/drag gestures when move/resize drag starts
- Date: Tue, 10 Mar 2015 15:48:34 +0000 (UTC)
commit 622a930c5a55aa64489a8031cd507f45e7fa2545
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Mar 10 16:38:17 2015 +0100
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
gtk/gtkwindow.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 7dee0df..1cac7b3 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -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));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]