Revert "frames: Always initialize _MUTTER_FRAME_EXTENTS to zero"

The _MUTTER_FRAME_EXTENTS need to have the correct size before the
window is shown, otherwise the client window size will effectively have
the headarbar height subtracted when initially syncing the frame/client
geometries.

This reverts commit f10b3eac62.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3628>
This commit is contained in:
Sebastian Keller 2024-03-01 10:46:13 +01:00
parent c12991936e
commit 9e77d45704

View File

@ -532,6 +532,8 @@ meta_frame_new (Window window)
GdkDisplay *display;
GtkWidget *frame, *header, *content;
GdkSurface *surface;
int frame_height = 0;
double scale;
frame = g_object_new (META_TYPE_FRAME, NULL);
@ -546,9 +548,21 @@ meta_frame_new (Window window)
surface = gtk_native_get_surface (GTK_NATIVE (frame));
gdk_x11_surface_set_frame_sync_enabled (surface, TRUE);
update_extents (META_FRAME (frame), (GtkBorder) { 0, 0, 0, 0 });
frame_sync_wm_state (META_FRAME (frame), window);
if (!gtk_window_is_fullscreen (GTK_WINDOW (frame)))
{
gtk_widget_measure (header,
GTK_ORIENTATION_VERTICAL, 1,
&frame_height,
NULL, NULL, NULL);
}
scale = gdk_surface_get_scale_factor (gtk_native_get_surface (GTK_NATIVE (frame)));
update_extents (META_FRAME (frame),
(GtkBorder) { 0, 0, frame_height * scale, 0 });
frame_sync_net_wm_visible_name (GTK_WINDOW (frame), window);
frame_sync_net_wm_name (GTK_WINDOW (frame), window);
frame_sync_wm_name (GTK_WINDOW (frame), window);