gdk/wayland: Use event window to calculate coordinatess for show_window_menu()
The previously used window always was the xdg_toplevel window.
This commit is contained in:
@ -4457,6 +4457,7 @@ gdk_wayland_window_show_window_menu (GdkWindow *window,
|
|||||||
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||||
struct wl_seat *seat;
|
struct wl_seat *seat;
|
||||||
GdkWaylandDevice *device;
|
GdkWaylandDevice *device;
|
||||||
|
GdkWindow *event_window;
|
||||||
double x, y;
|
double x, y;
|
||||||
uint32_t serial;
|
uint32_t serial;
|
||||||
|
|
||||||
@ -4476,12 +4477,13 @@ gdk_wayland_window_show_window_menu (GdkWindow *window,
|
|||||||
|
|
||||||
device = GDK_WAYLAND_DEVICE (gdk_event_get_device (event));
|
device = GDK_WAYLAND_DEVICE (gdk_event_get_device (event));
|
||||||
seat = gdk_wayland_device_get_wl_seat (GDK_DEVICE (device));
|
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);
|
gdk_window_coords_to_parent (event_window, x, y, &x, &y);
|
||||||
window = gdk_window_get_effective_parent (window);
|
event_window = gdk_window_get_effective_parent (event_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
serial = _gdk_wayland_device_get_implicit_grab_serial (device, event);
|
serial = _gdk_wayland_device_get_implicit_grab_serial (device, event);
|
||||||
|
|||||||
Reference in New Issue
Block a user