Merge branch 'wip/keep-scale-3-24' into 'gtk-3-24'

wayland/window: Only update the scale if on any outputs

See merge request GNOME/gtk!4353
This commit is contained in:
Matthias Clasen 2022-01-12 19:45:50 +00:00
commit dac9baf3b1

View File

@ -753,13 +753,24 @@ window_update_scale (GdkWindow *window)
return; return;
} }
if (!impl->display_server.outputs)
{
scale = impl->scale;
}
else
{
scale = 1; scale = 1;
for (l = impl->display_server.outputs; l != NULL; l = l->next) for (l = impl->display_server.outputs; l != NULL; l = l->next)
{ {
guint32 output_scale = struct wl_output *output = l->data;
_gdk_wayland_screen_get_output_scale (display_wayland->screen, l->data); uint32_t output_scale;
output_scale =
_gdk_wayland_screen_get_output_scale (display_wayland->screen,
output);
scale = MAX (scale, output_scale); scale = MAX (scale, output_scale);
} }
}
/* Notify app that scale changed */ /* Notify app that scale changed */
gdk_wayland_window_maybe_configure (window, window->width, window->height, scale); gdk_wayland_window_maybe_configure (window, window->width, window->height, scale);