From: Timm Bäder Date: Sun, 17 May 2020 13:28:16 +0000 (+0200) Subject: windowhandle: Apply surface transform before passing coords to GDK X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~17^2~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=74a1c60dd41fafd53a64d570b62fc3f09b86a90b;p=gtk4.git windowhandle: Apply surface transform before passing coords to GDK Otherwise coordinates are incorrect and the window can jump around after starting a drag. --- diff --git a/gtk/gtkwindowhandle.c b/gtk/gtkwindowhandle.c index 3e411465b5..6ee052e9a4 100644 --- a/gtk/gtkwindowhandle.c +++ b/gtk/gtkwindowhandle.c @@ -442,7 +442,8 @@ drag_gesture_update_cb (GtkGestureDrag *gesture, { GdkEventSequence *sequence; double start_x, start_y; - gint window_x, window_y; + int native_x, native_y; + int window_x, window_y; GtkNative *native; GdkSurface *surface; @@ -480,6 +481,10 @@ drag_gesture_update_cb (GtkGestureDrag *gesture, start_x, start_y, &window_x, &window_y); + gtk_native_get_surface_transform (native, &native_x, &native_y); + window_x += native_x; + window_y += native_y; + surface = gtk_native_get_surface (native); gdk_surface_begin_move_drag (surface, gtk_gesture_get_device (GTK_GESTURE (gesture)),