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

If we ended up on no output at all, keep the HiDPI scale as is, as it
likely means we were on a workspace that was switched away from. By
keeping the same scale, we avoid unnecessary scale changes that would
otherwise take place if the scale when on monitors would end up being
more than 1.
This commit is contained in:
Jonas Ådahl
2022-01-07 19:28:36 +01:00
parent 92ca52822c
commit 6efcc02806

View File

@@ -780,12 +780,23 @@ gdk_wayland_surface_update_scale (GdkSurface *surface)
return;
}
if (!impl->display_server.outputs)
{
scale = impl->scale;
}
else
{
scale = 1;
for (l = impl->display_server.outputs; l != NULL; l = l->next)
{
guint32 output_scale = gdk_wayland_display_get_output_scale (display_wayland, l->data);
struct wl_output *output = l->data;
uint32_t output_scale;
output_scale = gdk_wayland_display_get_output_scale (display_wayland,
output);
scale = MAX (scale, output_scale);
}
}
/* Notify app that scale changed */
gdk_wayland_surface_maybe_resize (surface,