diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c index 14f15d66a..def62c49a 100644 --- a/src/backends/meta-backend.c +++ b/src/backends/meta-backend.c @@ -409,13 +409,6 @@ meta_backend_monitor_device (MetaBackend *backend, create_device_monitor (backend, device); } -static inline gboolean -device_is_physical_touchscreen (ClutterInputDevice *device) -{ - return (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_LOGICAL && - clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE); -} - static inline gboolean check_has_pointing_device (ClutterSeat *seat) { @@ -454,11 +447,15 @@ on_device_added (ClutterSeat *seat, create_device_monitor (backend, device); - if (device_is_physical_touchscreen (device)) - meta_cursor_tracker_set_pointer_visible (priv->cursor_tracker, FALSE); + if (clutter_input_device_get_device_mode (device) == + CLUTTER_INPUT_MODE_LOGICAL) + return; device_type = clutter_input_device_get_device_type (device); + if (device_type == CLUTTER_TOUCHSCREEN_DEVICE) + meta_cursor_tracker_set_pointer_visible (priv->cursor_tracker, FALSE); + if (device_type == CLUTTER_TOUCHSCREEN_DEVICE || device_type == CLUTTER_TABLET_DEVICE || device_type == CLUTTER_PEN_DEVICE || @@ -478,6 +475,10 @@ on_device_removed (ClutterSeat *seat, destroy_device_monitor (backend, device); + if (clutter_input_device_get_device_mode (device) == + CLUTTER_INPUT_MODE_LOGICAL) + return; + meta_input_mapper_remove_device (priv->input_mapper, device); /* If the device the user last interacted goes away, check again pointer