frames: Always initialize _MUTTER_FRAME_EXTENTS to zero

The frame size_allocate() will set it correctly once show() is called by
the window tracker.

This is less code and also help reduces the chance of a brief visual
glitch in fullscreen games during startup. If the window is initially
still decorated the gray area would still show up until the next redraw,
which due to loading times can take a while.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3608>
This commit is contained in:
Sebastian Keller 2024-02-22 00:20:38 +01:00 committed by Marge Bot
parent bcdd282e9c
commit f10b3eac62

View File

@ -532,8 +532,6 @@ 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);
@ -548,21 +546,9 @@ 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);