mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
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. https://gitlab.gnome.org/GNOME/mutter/merge_requests/229
This commit is contained in:
parent
e2e7296612
commit
7d82cdeea3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user