GNOME Bugzilla – Bug 658274
Handle disabled devices
Last modified: 2018-02-13 14:47:03 UTC
Right now GdkDeviceManager considers "disabled" devices to be gone. In gnome-settings-daemon we would like to access those disabled devices, in particular to be able to re-enable them. The API might be: - stop considering "disabled" devices as gone - add a "disabled" property
Out of interest, how does one reenable disabled devices in XI2 ? I couldn't find API to do it...
(In reply to comment #1) > Out of interest, how does one reenable disabled devices in XI2 ? > I couldn't find API to do it... The "Device Enabled" property controls that: http://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/common/gsd-input-helper.c#n287
Oh. Sneaky. We already have a way to disable devices on the gdk side: http://developer.gnome.org/gdk3/3.2/GdkDevice.html#GdkInputMode So, what we do here will have to integrate with that, somehow.
I might be wrong, but this doesn't work globally, only per-application. For example, GIMP would use this mode to not receive any events from the pen, and only from the eraser, but switching applications, the events would still be sent to the appropriate window. The "Device Enabled" XI property completely stops any events being reported for any application.
Yes, that is a bit different. So maybe just having a 'disabled' boolean on devices would be enough.
Carlos, Peter, what's the difference between the XIDeviceDisabled/XIDeviceEnabled flags in the XIHierarchyEvent, and the "Device Enabled" property? Are they independent? (I'm guessing they aren't since toggling the property creates events with those flags). Is there a better way to see devices going away? If so, I think that we might be able to fix this by setting the "input-mode" to disabled when the device has been disabled, instead of removing it from the list of devices.
The device property pre-dates XI2 and was an attempt to get a good unified behaviour to disable all devices. because of that, the XIChangeHierarchy doesn't have a protocol approach to enabling/disabling slave devices (only to add a new master that should be enabled/disabled at startup). They're hooked up to each other, so toggling the property will generate a XIHierarchyEvent. If you just want to monitor the device, both approaches are fine, but you can't change the hierarchy with the property and you can't enable/disable a device with the protocol request. In your case, since you want to toggle the property I'd go for monitoring the property, it'll be nicer in code.
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
We should fix this by implementing the feature directly in mutter, instead of going through client APIs. See https://gitlab.gnome.org/GNOME/mutter/issues/33