[gtk/gtk-3-24: 1/2] gdk/wayland: Use event window to calculate coordinatess for show_window_menu()



commit df6ea75a044afc9d3ea2a9eaaf3eddfb5022a567
Author: Robert Mader <robert mader posteo de>
Date:   Sat Apr 13 17:26:21 2019 +0200

    gdk/wayland: Use event window to calculate coordinatess for show_window_menu()
    
    The previously used window always was the xdg_toplevel window.

 gdk/wayland/gdkwindow-wayland.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 7007f30ce3..3c26c2971b 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -4457,6 +4457,7 @@ gdk_wayland_window_show_window_menu (GdkWindow *window,
     GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
   struct wl_seat *seat;
   GdkWaylandDevice *device;
+  GdkWindow *event_window;
   double x, y;
   uint32_t serial;
 
@@ -4476,12 +4477,13 @@ gdk_wayland_window_show_window_menu (GdkWindow *window,
 
   device = GDK_WAYLAND_DEVICE (gdk_event_get_device (event));
   seat = gdk_wayland_device_get_wl_seat (GDK_DEVICE (device));
-  gdk_event_get_coords (event, &x, &y);
 
-  while (gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL)
+  gdk_event_get_coords (event, &x, &y);
+  event_window = gdk_event_get_window (event);
+  while (gdk_window_get_window_type (event_window) != GDK_WINDOW_TOPLEVEL)
     {
-      gdk_window_coords_to_parent (window, x, y, &x, &y);
-      window = gdk_window_get_effective_parent (window);
+      gdk_window_coords_to_parent (event_window, x, y, &x, &y);
+      event_window = gdk_window_get_effective_parent (event_window);
     }
 
   serial = _gdk_wayland_device_get_implicit_grab_serial (device, event);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]