wayland: prefer a manually requested size over the configure hint

When a window receives a resize request, it might ignore this new size and
use the compositor's size hints instead to restore to floating mode.

This commit changes that behaviour in that a window will always prefer
the manually resized dimensions over the compositor's hint.
This commit is contained in:
Christian Rauch 2020-05-17 02:19:43 +01:00
parent 4da9692061
commit 8e99b3f079

View File

@ -202,6 +202,7 @@ struct _GdkWindowImplWayland
int saved_width;
int saved_height;
gboolean saved_size_changed;
int unconfigured_width;
int unconfigured_height;
@ -1637,11 +1638,16 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
* When transitioning from maximize or fullscreen state, this means
* the client should configure its size back to what it was before
* being maximize or fullscreen.
* Additionally, if we receive a manual resize request, we must prefer this
* new size instead of the compositor's size hints.
* In such a scenario, and without letting the compositor know about the new
* size, the client has to manage all dimensions and ignore any server hints.
*/
if (saved_size && !fixed_size)
if (!fixed_size && (saved_size || impl->saved_size_changed))
{
width = impl->saved_width;
height = impl->saved_height;
impl->saved_size_changed = FALSE;
}
if (width > 0 && height > 0)
@ -3478,6 +3484,7 @@ gdk_window_wayland_move_resize (GdkWindow *window,
{
impl->saved_width = width;
impl->saved_height = height;
impl->saved_size_changed = (width > 0 && height > 0);
}
/* If this function is called with width and height = -1 then that means