From 9ff008e31bef7fee1aae840ce9a15a1698681ea0 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 27 Jan 2023 22:16:44 +0100 Subject: [PATCH] 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: --- src/x11/window-x11.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index 1fc4eb98f..34dbeb855 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -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 */