diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-05-17 12:06:26 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-05-17 12:49:26 -0400 |
commit | f316fe0f58014d6fa24dcc62df01a4a2c1e7d4f7 (patch) | |
tree | 91c2ada5038d78ce7888ae70dd48b97795f0085a /gtk/gtkwindow.c | |
parent | 309a7aa253b0e6d4721a8eafb6ce035787df7b88 (diff) | |
download | gtk+-f316fe0f58014d6fa24dcc62df01a4a2c1e7d4f7.tar.gz |
window: Use toplevel begin_move/resize api
The GdkSurface api for this is going away.
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r-- | gtk/gtkwindow.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index ddfb38792f..eb572e5486 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -1218,12 +1218,14 @@ click_gesture_pressed_cb (GtkGestureClick *gesture, GdkEventSequence *sequence; GtkWindowRegion region; GdkEvent *event; + GdkDevice *device; guint button; double tx, ty; sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture)); button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture)); event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence); + device = gtk_gesture_get_device (GTK_GESTURE (gesture)); if (!event) return; @@ -1234,8 +1236,7 @@ click_gesture_pressed_cb (GtkGestureClick *gesture, if (priv->maximized) return; - if (gdk_display_device_is_grabbed (gtk_widget_get_display (GTK_WIDGET (window)), - gtk_gesture_get_device (GTK_GESTURE (gesture)))) + if (gdk_display_device_is_grabbed (gtk_widget_get_display (GTK_WIDGET (window)), device)) return; region = get_active_region_type (window, x, y); @@ -1246,12 +1247,12 @@ click_gesture_pressed_cb (GtkGestureClick *gesture, gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED); gdk_event_get_position (event, &tx, &ty); - gdk_surface_begin_resize_drag (priv->surface, - (GdkSurfaceEdge) region, - gdk_event_get_device ((GdkEvent *) event), - GDK_BUTTON_PRIMARY, - tx, ty, - gdk_event_get_time (event)); + gdk_toplevel_begin_resize (GDK_TOPLEVEL (priv->surface), + (GdkSurfaceEdge) region, + device, + GDK_BUTTON_PRIMARY, + tx, ty, + gdk_event_get_time (event)); gtk_event_controller_reset (GTK_EVENT_CONTROLLER (gesture)); } |