window/x11: Keep buffer size if resize is not allowed

Mutter would deny the application the right to resize itself during an
interactive resize, to avoid the user and the client to fight for the
size.

When the client is not allowed to resize, it would use the client rect
rather than the buffer rect.

As a result, the client window with client side decorations would
quickly shrink to its minimum size.

Use the buffer rect instead, so that the size really remains the same.

https://gitlab.gnome.org/GNOME/mutter/-/issues/1674

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1777>
This commit is contained in:
Olivier Fourdan 2021-03-12 16:18:07 +01:00 committed by Marge Bot
parent cc928ba7d2
commit a2a161eb1e

View File

@ -2502,6 +2502,7 @@ meta_window_move_resize_request (MetaWindow *window,
gboolean allow_position_change; gboolean allow_position_change;
gboolean in_grab_op; gboolean in_grab_op;
MetaMoveResizeFlags flags; MetaMoveResizeFlags flags;
MetaRectangle buffer_rect;
/* We ignore configure requests while the user is moving/resizing /* We ignore configure requests while the user is moving/resizing
* the window, since these represent the app sucking and fighting * the window, since these represent the app sucking and fighting
@ -2573,8 +2574,9 @@ meta_window_move_resize_request (MetaWindow *window,
window->type); window->type);
} }
width = window->rect.width; meta_window_get_buffer_rect (window, &buffer_rect);
height = window->rect.height; width = buffer_rect.width;
height = buffer_rect.height;
if (!in_grab_op || !meta_grab_op_is_resizing (window->display->grab_op)) if (!in_grab_op || !meta_grab_op_is_resizing (window->display->grab_op))
{ {
if (value_mask & CWWidth) if (value_mask & CWWidth)