It is possible that we get a DeviceChanged event for a device
that is not in the hash table yet. E.g. I've seen this when
using xrandr to change screen resolution. Prevent a crash in
this case.
https://bugzilla.gnome.org/review?bug=678439
device = g_hash_table_lookup (manager_xi2->devices_by_id,
GINT_TO_POINTER (xev->deviceid));
- _clutter_input_device_reset_axes (device);
- _clutter_input_device_reset_scroll_info (device);
- translate_device_classes (backend_x11->xdpy,
- device,
- xev->classes,
- xev->num_classes);
+ if (device)
+ {
+ _clutter_input_device_reset_axes (device);
+ _clutter_input_device_reset_scroll_info (device);
+ translate_device_classes (backend_x11->xdpy,
+ device,
+ xev->classes,
+ xev->num_classes);
+ }
}
retval = CLUTTER_TRANSLATE_REMOVE;
break;