From 7aa56499ff2545b019edad3081e3aa751cd80e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 30 May 2022 19:48:52 +0200 Subject: [PATCH] backend: Sync cursor visibility after startup When the stage is technically shown depends on when the plugin decides to do so, so don't rely on it happening when everything is setup. Part-of: --- src/backends/meta-backend.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c index 606c0eda6..67becc7b8 100644 --- a/src/backends/meta-backend.c +++ b/src/backends/meta-backend.c @@ -516,7 +516,15 @@ input_mapper_device_aspect_ratio_cb (MetaInputMapper *mapper, } static void -on_stage_shown_cb (MetaBackend *backend) +on_prepare_shutdown (MetaContext *context, + MetaBackend *backend) +{ + g_signal_emit (backend, signals[PREPARE_SHUTDOWN], 0); +} + +static void +on_started (MetaContext *context, + MetaBackend *backend) { MetaBackendPrivate *priv = meta_backend_get_instance_private (backend); ClutterSeat *seat = priv->default_seat; @@ -525,13 +533,6 @@ on_stage_shown_cb (MetaBackend *backend) determine_hotplug_pointer_visibility (seat)); } -static void -on_prepare_shutdown (MetaContext *context, - MetaBackend *backend) -{ - g_signal_emit (backend, signals[PREPARE_SHUTDOWN], 0); -} - static void meta_backend_real_post_init (MetaBackend *backend) { @@ -542,9 +543,6 @@ meta_backend_real_post_init (MetaBackend *backend) priv->stage = meta_stage_new (backend); clutter_actor_realize (priv->stage); META_BACKEND_GET_CLASS (backend)->select_stage_events (backend); - g_signal_connect_object (priv->stage, "show", - G_CALLBACK (on_stage_shown_cb), backend, - G_CONNECT_SWAPPED); meta_monitor_manager_setup (priv->monitor_manager); @@ -595,6 +593,8 @@ meta_backend_real_post_init (MetaBackend *backend) g_signal_connect (priv->context, "prepare-shutdown", G_CALLBACK (on_prepare_shutdown), backend); + g_signal_connect (priv->context, "started", + G_CALLBACK (on_started), backend); } static gboolean