After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 658274 - Handle disabled devices
Handle disabled devices
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Class: GdkDevice
3.8.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
Carlos Garnacho
Depends on:
Blocks:
 
 
Reported: 2011-09-05 16:36 UTC by Bastien Nocera
Modified: 2018-02-13 14:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bastien Nocera 2011-09-05 16:36:35 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
Comment 1 Matthias Clasen 2011-11-05 04:15:47 UTC
Out of interest, how does one reenable disabled devices in XI2 ?
I couldn't find API to do it...
Comment 2 Bastien Nocera 2011-11-07 13:48:26 UTC
(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
Comment 3 Matthias Clasen 2011-11-07 18:28:56 UTC
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.
Comment 4 Bastien Nocera 2011-11-07 18:52:47 UTC
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.
Comment 5 Matthias Clasen 2011-11-08 06:25:55 UTC
Yes, that is a bit different. So maybe just having a 'disabled' boolean on devices would be enough.
Comment 6 Bastien Nocera 2013-08-23 23:56:52 UTC
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.
Comment 7 Peter Hutterer 2013-08-24 01:01:41 UTC
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.
Comment 8 Matthias Clasen 2018-02-10 05:11:27 UTC
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.
Comment 9 Bastien Nocera 2018-02-13 14:47:03 UTC
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