backend: Ignore events without source_device for pointer visibility

There can be events which don't not have source devices set on them, because
they are not backed by real hardware and rather generated by us, for example
IM events coming from the shell's OSK.

So don't assume all events have a source device in
update_pointer_visibility_from_event() and rather ignore those without one,
as we are only interested in events coming from "real hardware" here.

This fixes an issue where the mouse pointer would appear on devices without
any input from actual mice/touchpads on OSK key presses.

Fixes: 6aa42d6dad
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3236>
This commit is contained in:
Jonas Dreßler 2023-09-03 12:11:39 +02:00 committed by Marge Bot
parent aa6888e6bd
commit e303551745

View File

@ -1053,6 +1053,9 @@ update_pointer_visibility_from_event (MetaBackend *backend,
g_warn_if_fail (!priv->in_init);
device = clutter_event_get_source_device (event);
if (!device)
return;
device_type = clutter_input_device_get_device_type (device);
time_ms = clutter_event_get_time (event);