backends: Make pointer cursor invisible until the stage is shown

We are able to show the cursor before that, it doesn't mean we should.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
This commit is contained in:
Carlos Garnacho 2020-10-28 19:41:40 +01:00 committed by Marge Bot
parent fb2440a1cf
commit efc1592d4d
2 changed files with 12 additions and 1 deletions

View File

@ -563,6 +563,14 @@ input_mapper_device_aspect_ratio_cb (MetaInputMapper *mapper,
meta_input_settings_set_device_aspect_ratio (input_settings, device, aspect_ratio);
}
static void
on_stage_shown_cb (MetaBackend *backend)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
meta_cursor_tracker_set_pointer_visible (priv->cursor_tracker, TRUE);
}
static void
meta_backend_real_post_init (MetaBackend *backend)
{
@ -572,6 +580,9 @@ 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);

View File

@ -196,7 +196,7 @@ meta_cursor_tracker_init (MetaCursorTracker *tracker)
MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
priv->is_showing = TRUE;
priv->is_showing = FALSE;
priv->x = -1.0;
priv->y = -1.0;
}