[mutter] backend: Freeze frame clock when headless
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] backend: Freeze frame clock when headless
- Date: Fri, 9 Nov 2018 10:23:32 +0000 (UTC)
commit 25c53b2fb25d325a40cb12b2e38b2a895983f441
Author: Jonas Ådahl <jadahl gmail com>
Date: Thu Jul 12 16:21:55 2018 +0200
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
src/backends/meta-backend.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
---
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index 375e9d298..709d4194c 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]