GNOME Bugzilla – Bug 747274
keyboard: Add a way to use the OSK on shell chrome in wayland sessions
Last modified: 2015-06-04 11:20:46 UTC
I'd like to include something like this as a short term hack for 3.16.1 so that we at least allow logging in with the OSK now that gdm runs in a wayland session by default. It requires an API addition to libcaribou but I added a check for it at runtime so that at least we don't break badly if that function isn't there. As the commit message says, a proper solution would be a lot more invasive and in fact, we need to consider the text protocol for wayland instead of generating key events but that also requires clients to have support for it. Anyway, comments welcome
Created attachment 300864 [details] [review] keyboard: Add a way to use the OSK on shell chrome in wayland sessions libcaribou was designed to generate X events which works under wayland sessions for X clients but obviously doesn't work for wayland clients and for shell chrome. This patch adds a simple caribou display adapter which inherits from its X display adapter and allows us to continue to work for X clients and at the same time makes the OSK work on shell text entries by sending key events directly to the focused text actor. Making the OSK work for wayland clients requires much bigger changes at various levels in the stack and either not using libcaribou or re-working it substantially so that's left for future work.
Review of attachment 300864 [details] [review]: ::: js/ui/keyboard.js @@ +736,3 @@ + + vfunc_keyval_press: function(keyval) { + if (Main.modalCount == 0) { Can't we do better than that? A modalCount greater 0 is sufficient for chrome input focus, but not necessary. At least chat notifications allow input without pushing a modal (though that functionality isn't really accessible on touch atm)
Created attachment 301464 [details] [review] keyboard: Add a way to use the OSK on shell chrome in wayland sessions -- > Can't we do better than that? A modalCount greater 0 is sufficient > for chrome input focus, but not necessary. True. In practice it seems like checking that the stage's key focus is on a ClutterText instance is enough since it gets reset to the stage itself when focus is on a client.
Review of attachment 301464 [details] [review]: OK ::: js/ui/keyboard.js @@ +749,3 @@ + if (!(focus instanceof Clutter.Text)) { + this.parent(keyval); + return; The "early" return in the only branch that actually does something is stylistically odd - this would make more sense to me as if (focus instanceof Clutter.Text) return; // do nothing this.parent(keyval); (to a lesser extent this applies above as well, where a simple if-else statement could be used)
Pushed with the style change, thanks Attachment 301464 [details] pushed as 5afd047 - keyboard: Add a way to use the OSK on shell chrome in wayland sessions
This doesn't seem to work for me, using gnome-shell 3.16.2. Do I need a specific version of caribou?
(In reply to Bastien Nocera from comment #6) > This doesn't seem to work for me, using gnome-shell 3.16.2. Do I need a > specific version of caribou? Ugh, yes, just realized that there was no caribou release yet including the needed patch. I pinged Ueno now, and will do it myself first thing on monday if one hasn't appeared yet.
This didn't work with touchscreens, but was fixed in the follow-up: https://bugzilla.gnome.org/show_bug.cgi?id=750287