[mutter/wip/carlosg/input-thread: 95/97] backends: Make pointer cursor invisible until the stage is shown
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/input-thread: 95/97] backends: Make pointer cursor invisible until the stage is shown
- Date: Wed, 28 Oct 2020 19:37:32 +0000 (UTC)
commit 38001219555eaeea10c507a0b456b87033d10305
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Oct 28 19:41:40 2020 +0100
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.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403
src/backends/meta-backend.c | 14 ++++++++++++--
src/backends/meta-cursor-tracker.c | 2 +-
2 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index 3140cc3cbd..88d05c5e49 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -578,6 +578,15 @@ 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);
+ ClutterSeat *seat = clutter_backend_get_default_seat (priv->clutter_backend);
+
+ set_initial_pointer_visibility (backend, seat);
+}
+
static void
meta_backend_real_post_init (MetaBackend *backend)
{
@@ -588,6 +597,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);
@@ -604,8 +616,6 @@ meta_backend_real_post_init (MetaBackend *backend)
G_CALLBACK (on_device_removed), backend,
G_CONNECT_AFTER);
- set_initial_pointer_visibility (backend, seat);
-
priv->input_settings = meta_backend_create_input_settings (backend);
if (priv->input_settings)
diff --git a/src/backends/meta-cursor-tracker.c b/src/backends/meta-cursor-tracker.c
index 8ca962c0e7..afd510268e 100644
--- a/src/backends/meta-cursor-tracker.c
+++ b/src/backends/meta-cursor-tracker.c
@@ -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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]