From f10b3eac62cfaa015984584a12567e6a59869b61 Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Thu, 22 Feb 2024 00:20:38 +0100 Subject: [PATCH] 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: --- src/frames/meta-frame.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/frames/meta-frame.c b/src/frames/meta-frame.c index f7fe27cfa..975560646 100644 --- a/src/frames/meta-frame.c +++ b/src/frames/meta-frame.c @@ -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);