mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
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
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user