[mutter/wip/carlosg/there-can-be-only-one: 4877/4879] backends: Keep cursor hidden on tablet input on Wayland
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/there-can-be-only-one: 4877/4879] backends: Keep cursor hidden on tablet input on Wayland
- Date: Wed, 12 Jan 2022 16:40:05 +0000 (UTC)
commit f6da33c26655630151d0b1c7f00e65533d327447
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Jan 12 12:53:42 2022 +0100
backends: Keep cursor hidden on tablet input on Wayland
Tablets have their own cursor, in order to avoid confusions just
hide the regular pointer like we do on touchscreens, so there's
the illusion that there is a single cursor.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/75
src/backends/meta-backend.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index a2396af056..bf0a7e0d7a 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -379,7 +379,7 @@ check_pointer_visibility (ClutterSeat *seat)
{
g_autoptr (GList) devices = NULL;
const GList *l;
- gboolean has_touchscreen = FALSE, has_pointer = FALSE;
+ gboolean has_touchscreen = FALSE, has_pointer = FALSE, has_tablet = FALSE;
devices = clutter_seat_list_devices (seat);
@@ -391,9 +391,12 @@ check_pointer_visibility (ClutterSeat *seat)
has_touchscreen = TRUE;
if (clutter_input_device_get_device_type (device) == CLUTTER_POINTER_DEVICE)
has_pointer = TRUE;
+ if (meta_is_wayland_compositor () &&
+ clutter_input_device_get_device_type (device) == CLUTTER_TABLET_DEVICE)
+ has_tablet = TRUE;
}
- return has_pointer && !has_touchscreen;
+ return has_pointer && !has_touchscreen && !has_tablet;
}
static void
@@ -1447,6 +1450,10 @@ update_last_device (MetaBackend *backend)
case CLUTTER_TOUCHSCREEN_DEVICE:
meta_cursor_tracker_set_pointer_visible (cursor_tracker, FALSE);
break;
+ case CLUTTER_TABLET_DEVICE:
+ meta_cursor_tracker_set_pointer_visible (cursor_tracker,
+ !meta_is_wayland_compositor ());
+ break;
default:
meta_cursor_tracker_set_pointer_visible (cursor_tracker, TRUE);
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]