x11: Do not use buffer size on configure requests unless managed

Windows that are decorated may get configure requests before
the frames client created a corresponding frame window and Mutter
reparented the window.

Since the configure request results in the buffer size being
used to update the window size and the window does not have a
buffer yet, these requests could mistakenly result in the client
window being given a minimal size.

In these situations, do not use the buffer size but the given
size. The window still has to undergo frame creation and
reparenting before being shown for the first time.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2588
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2605
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2808>
This commit is contained in:
Carlos Garnacho 2023-01-27 22:16:44 +01:00 committed by Marge Bot
parent 228d681be8
commit 9ff008e31b

View File

@ -2721,17 +2721,26 @@ meta_window_move_resize_request (MetaWindow *window,
window->type);
}
meta_window_get_buffer_rect (window, &buffer_rect);
width = buffer_rect.width;
height = buffer_rect.height;
if (!in_grab_op || !window_drag ||
!meta_grab_op_is_resizing (meta_window_drag_get_grab_op (window_drag)))
if (window->decorated && !window->frame)
{
if (value_mask & CWWidth)
width = new_width;
width = new_width;
height = new_height;
}
else
{
meta_window_get_buffer_rect (window, &buffer_rect);
width = buffer_rect.width;
height = buffer_rect.height;
if (value_mask & CWHeight)
height = new_height;
if (!in_grab_op || !window_drag ||
!meta_grab_op_is_resizing (meta_window_drag_get_grab_op (window_drag)))
{
if (value_mask & CWWidth)
width = new_width;
if (value_mask & CWHeight)
height = new_height;
}
}
/* ICCCM 4.1.5 */