From 2ae42f0db2ab21438b8a217706f1517ffd8952a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 30 Dec 2016 20:51:06 +0800 Subject: [PATCH] wayland/xdg-shell: Scale window menu coordinates When the monitor the surface is on has a scale other than 1, the coordinate of the window menu popup position needs to be scaled, as it is reported in logical pixels, while the stage is still in physical pixels. https://bugzilla.gnome.org/show_bug.cgi?id=776055 --- src/wayland/meta-wayland-xdg-shell.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index 62675873c..aa355da4a 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -227,13 +227,15 @@ xdg_toplevel_show_window_menu (struct wl_client *client, { MetaWaylandSeat *seat = wl_resource_get_user_data (seat_resource); MetaWaylandSurface *surface = surface_from_xdg_toplevel_resource (resource); + int monitor_scale; if (!meta_wayland_seat_get_grab_info (seat, surface, serial, FALSE, NULL, NULL)) return; + monitor_scale = surface->window->monitor->scale; meta_window_show_menu (surface->window, META_WINDOW_MENU_WM, - surface->window->buffer_rect.x + x, - surface->window->buffer_rect.y + y); + surface->window->buffer_rect.x + (x * monitor_scale), + surface->window->buffer_rect.y + (y * monitor_scale)); } static void