GNOME Bugzilla – Bug 683712
Invocation of on screen keyboard
Last modified: 2014-09-05 07:45:00 UTC
What kind of invocation methods does caribou or gnome onscreen keyboard supports (to show and hide) to non gtk applications? By peeking to sources I see "org.gnome.Caribou.Keyboard" dbus interface. How general is to use this interface in Linux environment and is it stable enough? Reference bug: https://bugzilla.mozilla.org/show_bug.cgi?id=789038 Firefox doesn't use GTK directly so there's missing GTK on_focus event, we're looking for possible long term solution.
The dbus service is not meant to be used externally. The two methods that are used for bringing up the keyboard are IM, which I think is disabled. And AT-SPI (the a11y interface). Firefox needs to fire the right kind of a11y focus event for the keyboard to show up. I think it already does.
(In reply to comment #1) > The dbus service is not meant to be used externally. Well, I think that this is what gnome-shell does. Take a look to http://git.gnome.org/browse/gnome-shell/tree/js/ui/keyboard.js#n42 Does that mean that gnome-shell is not doing the right thing with the keyboard? If that the case, why create a DBUS service?
GNOME Shell implements a caribou keyboard. When I meant not to be used externally, I meant by any application that needs keyboard input.
Thanks for a clue. Could you please tell me what you mean by IM is disabled (for caribou or unsupported in caribou)? By IM do you mean: gtk_im_context_focus_in http://www.gtk.org/api/2.6/gtk/GtkIMContext.html#gtk-im-context-focus-in ? For AT-SPI do you mean: atspi_component_grab_focus http://developer.gnome.org/libatspi/2.4/libatspi-atspi-component.html#atspi-component-grab-focus ?
As a workaround for problems displaying OSK in cinnamon I use dbus-send --type=method_call --dest=org.gnome.Caribou.Keyboard /org/gnome/Caribou/Keyboard org.gnome.Caribou.Keyboard.Show in a custom launcher.
Created attachment 246525 [details] [review] start the caribou daemon with D-Bus activation Install the daemon to libexecdir. Make the daemon own a name on the session bus, and install a D-Bus service file for it. Allow the name to be replaced by another process, so that a D-Bus activated daemon can be replaced by a GSettings-key autostarted daemon. Using this patch, the OSK can be triggered by calling a D-Bus method to activate it, for example: gdbus call --session --dest org.gnome.Caribou.Daemon --object-path /org/gnome/Caribou/Daemon --method org.freedesktop.DBus.Peer.Ping
Review of attachment 246525 [details] [review]: Kudos that you found a simple way to activate caribou without D-Bus API change. Looks fine, except one thing: ::: daemon/daemon.vala @@ +12,3 @@ } + [DBus (name = "org.gnome.Caribou.Daemon")] This results in run() and quit() being exposed to D-Bus, which I don't think we want.
Created attachment 247598 [details] [review] allow run to be called multiple times Improve patch by allowing run() to be called multiple times. (In reply to comment #7) > ::: daemon/daemon.vala > @@ +12,3 @@ > } > > + [DBus (name = "org.gnome.Caribou.Daemon")] > > This results in run() and quit() being exposed to D-Bus, which I don't think we > want. It is convenient to have quit() exposed to D-Bus, as the current patch to gnome-settings-daemon in bug 692771 uses it to terminate the daemon over D-Bus. I will update that patch to use run() (or potentially a new start() method) and quit(), as Bastien requested.
Created attachment 250098 [details] [review] drop the autostart file, activate over D-Bus only Following what Bastien suggested in bug 692771, comment #17, I updated the patch to make Caribou only D-Bus activatable.
Review of attachment 250098 [details] [review]: Looks good, thanks.
Comment on attachment 250098 [details] [review] drop the autostart file, activate over D-Bus only Pushed to master as 147d3ecde3ec5f9153ce05208a043a802d320b3d to go along with bug 702015.
Created attachment 285448 [details] [review] workaround patch I heard of an intermittent crash of caribou on Continuous, after this change: http://build.gnome.org/continuous/buildmaster/builds/2014/09/03/20/smoketest/output.txt Not sure if this is related, but I see an issue in the current code. This works: $ gdbus call --session -d org.gnome.Caribou.Daemon \ -o /org/gnome/Caribou/Daemon \ -m org.gnome.Caribou.Daemon.Quit () That means /usr/libexec/caribou is launched through D-Bus activation and Daemon.quit() is called over D-Bus. However, this doesn't work as expected: $ gdbus call --session -d org.gnome.Caribou.Daemon \ -o /org/gnome/Caribou/Daemon \ -m org.gnome.Caribou.Daemon.Run Error: Timeout was reached (According to introspection data, you need to pass '') That means that the multiple invocation guard in Daemon.run(), by checking "keyboard != null", has no effect, since Bus.get_proxy() creates a separate thread. Actually, Daemon.run() doesn't need to be called over D-Bus, because it is called from main at startup. So, how about changing this to something like the attached?
Review of attachment 285448 [details] [review]: Seems fine to me.