mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
backend: Freeze frame clock when headless
Don't schedule redraws when being headless; there is nothing to draw so don't attempt to draw. This also makes a flaky test become non-flaky, as it previously spuriously got warnings due to windows being "painted" when headless but lacking frame timings, as nothing was actually painted. https://gitlab.gnome.org/GNOME/mutter/merge_requests/170
This commit is contained in:
parent
213ed80284
commit
25c53b2fb2
@ -123,6 +123,8 @@ struct _MetaBackendPrivate
|
||||
guint sleep_signal_id;
|
||||
GCancellable *cancellable;
|
||||
GDBusConnection *system_bus;
|
||||
|
||||
gboolean was_headless;
|
||||
};
|
||||
typedef struct _MetaBackendPrivate MetaBackendPrivate;
|
||||
|
||||
@ -223,6 +225,19 @@ meta_backend_monitors_changed (MetaBackend *backend)
|
||||
}
|
||||
|
||||
meta_cursor_renderer_force_update (priv->cursor_renderer);
|
||||
|
||||
if (meta_monitor_manager_is_headless (priv->monitor_manager) &&
|
||||
!priv->was_headless)
|
||||
{
|
||||
clutter_stage_freeze_updates (CLUTTER_STAGE (priv->stage));
|
||||
priv->was_headless = TRUE;
|
||||
}
|
||||
else if (!meta_monitor_manager_is_headless (priv->monitor_manager) &&
|
||||
priv->was_headless)
|
||||
{
|
||||
clutter_stage_thaw_updates (CLUTTER_STAGE (priv->stage));
|
||||
priv->was_headless = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user