mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-08 01:53:35 +02:00
When a USB HID device (keyboard/mouse) is disconnected, X11 fires an XI_HierarchyChanged event, which triggers read_xi_scroll_devices(). That function calls XIGetProperty() on devices from XIQueryDevice(). There is a race condition: if a device is removed between these calls, X11 generates an XI_BadDevice error. Without a custom error handler, the default X11 handler calls exit(), killing kitty. Fix: wrap the device query loop in read_xi_scroll_devices() with _glfwGrabErrorHandlerX11() / _glfwReleaseErrorHandlerX11() so that any XI_BadDevice error is captured by kitty's own handler rather than the default fatal one. Fixes #9723 Fixes #9724
34 KiB
Vendored
34 KiB
Vendored