diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2016-12-30 20:51:06 +0800 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2017-01-03 15:30:41 +0800 |
commit | 2ae42f0db2ab21438b8a217706f1517ffd8952a9 (patch) | |
tree | e29f1ffe56c9ee79ea8b2dab870e6c4d600946de /src | |
parent | 06f5b6b3e37eb96b91b475b1e57a3f1056ab815a (diff) | |
download | mutter-2ae42f0db2ab21438b8a217706f1517ffd8952a9.tar.gz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/wayland/meta-wayland-xdg-shell.c | 6 |
1 files 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 |