Bug 3548

Summary: RFE: should reopen mouse devices on USB reconnect
Product: xorg Reporter: Daniel Stone <daniel>
Component: Input/MouseAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: high    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description FreeDesktop Bugzilla Database Corruption Fix User 2005-06-16 04:40:29 UTC
There should be "hotplug" support in X mouse driver layer, allowing to
connect/disconnect USB mouse on fly. I know that if one uses "/dev/input/mice",
then it would work this way automatically, but I have several mice - trackpoint,
configured as a separate input device to enable EmulateWheel on button 2,
touchpad, using the synaptics driver to provide advanced touchpad features, and
a USB mouse, configured to use it's own device.
I believe that if I make my USB mouse use /dev/input/mice while keeping touchpad
and trackpoint entries, their events would be doubled (received through their
separate entries and through /dev/input/mice), which is outright wrong. So I
have to use /dev/input/mouse_touchpad, /dev/input/mouse_trackpoint and
/dev/input/mouse_usbmouse. These device nodes are created by udev (I've wrote
udev.rules for them).
If I unplug my USB mouse when running X, the /dev/input/mouse_usbmouse device
disappears, then when I plug the mouse back, the device reappears, but X has the
old (disappeared) file opened, so the mouse no longer works. I don't know what's
the best way to fix X here, but if it's possible to sense mouse disconnect
(device disappearance), X could try to reopen the device periodically (or sense
it's reappearance if it's possible). One way to "sense this" could be using
directory update notifications (like inotify in linux 2.6). Another way would be
to access lower-level USB details (though, I understand that periodic polling is
not desirable).
The simplest way could probably just export some userland interface to notify
the X server about mouse disconnect/reconnect, or to just re-open all or some of
the input devices - then, userland scripts could be hooked to usb hotplug agent.
Comment 1 Adam Jackson 2005-06-28 14:21:38 UTC

*** This bug has been marked as a duplicate of 971 ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.