From: Jonas Ã…dahl Date: Tue, 18 Jan 2022 14:45:30 +0000 (+0100) Subject: wayland: Don't always restore the saved size when floating X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~4^2~75^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=be7a391a131a9a5e3f7ef0460caf1e118b4e659a;p=gtk4.git wayland: Don't always restore the saved size when floating We only save the size when we transition from floating to fixed, so that we can restore the size to the one prior to being fixed. However, we should not restore to this size whenever we see a 0x0 size from xdg_toplevel, as it can do that any time it doesn't care about the size, e.g. when the surface is floating and just changing state. Fix this by only using the saved size when transitioning from fixed to floating, not when staying floating while previously floating. Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4634 --- diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 93498d7cb5..49309ffa86 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -1477,6 +1477,7 @@ gdk_wayland_surface_configure_toplevel (GdkSurface *surface) int width, height; gboolean is_resizing; gboolean fixed_size; + gboolean was_fixed_size; gboolean saved_size; new_state = impl->pending.toplevel.state; @@ -1491,6 +1492,11 @@ gdk_wayland_surface_configure_toplevel (GdkSurface *surface) GDK_TOPLEVEL_STATE_TILED) || is_resizing; + was_fixed_size = + surface->state & (GDK_TOPLEVEL_STATE_MAXIMIZED | + GDK_TOPLEVEL_STATE_FULLSCREEN | + GDK_TOPLEVEL_STATE_TILED); + width = impl->pending.toplevel.width; height = impl->pending.toplevel.height; @@ -1503,7 +1509,7 @@ gdk_wayland_surface_configure_toplevel (GdkSurface *surface) * the client should configure its size back to what it was before * being maximize or fullscreen. */ - if (saved_size && !fixed_size) + if (saved_size && !fixed_size && was_fixed_size) { width = impl->saved_width; height = impl->saved_height;