diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2018-11-02 15:50:12 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-11-02 16:14:55 +0100 |
commit | 83f496229b06f07ee8eda669f6a36a09c691d1b5 (patch) | |
tree | c4b7157fab6b84f9794c8231fd28d0b6d4373d84 /src | |
parent | 0fea0e383c1709f94974b3f1a650fc08502295dc (diff) | |
download | mutter-83f496229b06f07ee8eda669f6a36a09c691d1b5.tar.gz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/backends/meta-backend.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c index afbb41dc7..84da437bd 100644 --- a/src/backends/meta-backend.c +++ b/src/backends/meta-backend.c @@ -309,6 +309,9 @@ check_has_pointing_device (ClutterDeviceManager *manager) if (clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE || clutter_input_device_get_device_type (device) == CLUTTER_KEYBOARD_DEVICE) continue; + if (clutter_input_device_get_device_type (device) == CLUTTER_TABLET_DEVICE && + meta_is_wayland_compositor ()) + continue; return TRUE; } @@ -328,8 +331,12 @@ check_pointer_visibility (ClutterDeviceManager *manager) { ClutterInputDevice *device = devices->data; - if (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER && - clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE) + if (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_SLAVE) + continue; + + if (clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE || + (clutter_input_device_get_device_type (device) == CLUTTER_TABLET_DEVICE && + meta_is_wayland_compositor ())) { pointer_visible = FALSE; break; @@ -1032,6 +1039,12 @@ update_last_device (MetaBackend *backend) { case CLUTTER_KEYBOARD_DEVICE: break; + case CLUTTER_TABLET_DEVICE: + if (meta_is_wayland_compositor ()) + meta_cursor_tracker_set_pointer_visible (cursor_tracker, FALSE); + else + meta_cursor_tracker_set_pointer_visible (cursor_tracker, TRUE); + break; case CLUTTER_TOUCHSCREEN_DEVICE: meta_cursor_tracker_set_pointer_visible (cursor_tracker, FALSE); break; |