GNOME Bugzilla – Bug 745977
Manage OSK visibility entirely within gnome-shell
Last modified: 2015-03-13 20:15:02 UTC
When the mutter patches from bug #712775 are in place, it will be possible to make gnome-shell implement keyboard visibility without relying on g-s-d dbus interfaces, I'm attaching a patch doing that.
Created attachment 299042 [details] [review] keyboard: Listen to MetaBackend::last-device-changed for OSK changes Instead of listening to a dbus property exported by g-s-d, listen to the MetaBackend signal telling the last interacted device, and make sure we only show the keyboard for touchscreens.
Review of attachment 299042 [details] [review]: otherwise looks good ::: js/ui/keyboard.js @@ +189,3 @@ + let device = manager.get_device(deviceId); + + if (device.get_device_name().search('XTEST') < 0) { search() creates a regex object which isn't necessary here. I'd just use indexOf() or includes() @@ +190,3 @@ + + if (device.get_device_name().search('XTEST') < 0) { + this._lastDeviceId = deviceId missing ';' @@ +213,3 @@ + _lastDeviceIsTouchscreen: function () { + if (!this._lastDeviceId) We should probably initialize this somehow, querying the device manager for a touchscreen device. In practice it's probably not a problem since the OSK isn't supposed to be shown when the shell starts but only when something gets focus and by then the user should have already used the touch screen...
Pushing with the indexOf/semicolon changes. lastDeviceId has been initialized to null. I wasn't sure what default value should we look for there, and focusing windows/text fields will surely require user interaction anyway. Attachment 299042 [details] pushed as ff1b76f - keyboard: Listen to MetaBackend::last-device-changed for OSK changes