Commit 7d82cdee authored by Jonas Ådahl's avatar Jonas Ådahl Committed by Florian Müllner

window/wayland: Freeze updates until shown

Not until the window is shown do we know what monitor it's on, thus the
size, so freeze updates (shape etc) until the window is shown.

!229
parent e2e72966
......@@ -57,6 +57,8 @@ struct _MetaWindowWayland
int last_sent_y;
int last_sent_width;
int last_sent_height;
gboolean has_been_shown;
};
struct _MetaWindowWaylandClass
......@@ -538,6 +540,19 @@ appears_focused_changed (GObject *object,
surface_state_changed (window);
}
static void
on_window_shown (MetaWindow *window)
{
MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (window);
gboolean has_been_shown;
has_been_shown = wl_window->has_been_shown;
wl_window->has_been_shown = TRUE;
if (!has_been_shown)
meta_compositor_sync_updates_frozen (window->display->compositor, window);
}
static void
meta_window_wayland_init (MetaWindowWayland *wl_window)
{
......@@ -547,6 +562,8 @@ meta_window_wayland_init (MetaWindowWayland *wl_window)
g_signal_connect (window, "notify::appears-focused",
G_CALLBACK (appears_focused_changed), NULL);
g_signal_connect (window, "shown",
G_CALLBACK (on_window_shown), NULL);
}
static void
......@@ -576,7 +593,9 @@ meta_window_wayland_is_stackable (MetaWindow *window)
static gboolean
meta_window_wayland_are_updates_frozen (MetaWindow *window)
{
return FALSE;
MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (window);
return !wl_window->has_been_shown;
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment