https://bugs.winehq.org/show_bug.cgi?id=56789
talchas@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |talchas@gmail.com
--- Comment #20 from talchas@gmail.com --- Yeah, a simpler way to trigger this is to just unplug your mouse / plug in a new one. The DeviceChanged event->sourceid is 0, not a valid device id, so XOpenDevice in update_device_mapping just dies.
I don't know if this should be event->deviceid in the first place (which is valid) or if it should just be skipped if sourceid is unset, but my guess from the vague text in XI2proto.txt is that sourceid is only set on reason == SlaveSwich.
As a somewhat separate issue, update_device_mapping tries to be defensive and catch XOpenDevice failures, but forgets that the Xlib API around errors is awful, and thus doesn't actually catch the error and the program just dies. (I'm not 100% sure if it would be possible to set up error_handler/ignore_error to work or not)
A typical event printed in gdb:
{type = 35, serial = 347, send_event = 0, display = 0x565c9590, extension = 131, evtype = 1, time = 1663560125, deviceid = 2, sourceid = 0, reason = 2, num_classes = 5, classes = 0x565d54c0}