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 745977 - Manage OSK visibility entirely within gnome-shell
Manage OSK visibility entirely within gnome-shell
Product: gnome-shell
Classification: Core
Component: keyboard
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
Depends on: 712775
Reported: 2015-03-10 18:10 UTC by Carlos Garnacho
Modified: 2015-03-13 20:15 UTC
See Also:
GNOME target: ---
GNOME version: ---

keyboard: Listen to MetaBackend::last-device-changed for OSK changes (3.84 KB, patch)
2015-03-10 18:12 UTC, Carlos Garnacho
accepted-commit_now Details | Review

Description Carlos Garnacho 2015-03-10 18:10:59 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.
Comment 1 Carlos Garnacho 2015-03-10 18:12:04 UTC
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.
Comment 2 Rui Matos 2015-03-10 18:42:00 UTC
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...
Comment 3 Carlos Garnacho 2015-03-13 20:15:02 UTC
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