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 683712 - Invocation of on screen keyboard
Invocation of on screen keyboard
Status: RESOLVED FIXED
Product: caribou
Classification: Applications
Component: default
git master
Other Linux
: Normal enhancement
: ---
Assigned To: caribou-maint
caribou-maint
Depends on:
Blocks: 692771 702015
 
 
Reported: 2012-09-10 11:28 UTC by Jan Horak
Modified: 2014-09-05 07:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
start the caribou daemon with D-Bus activation (5.52 KB, patch)
2013-06-11 14:07 UTC, David King
reviewed Details | Review
allow run to be called multiple times (6.08 KB, patch)
2013-06-24 07:31 UTC, David King
none Details | Review
drop the autostart file, activate over D-Bus only (4.51 KB, patch)
2013-07-25 11:13 UTC, David King
committed Details | Review
workaround patch (1.21 KB, patch)
2014-09-05 02:09 UTC, Daiki Ueno
committed Details | Review

Description Jan Horak 2012-09-10 11:28:35 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.
Comment 1 Eitan Isaacson 2012-09-10 16:46:44 UTC
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.
Comment 2 Alejandro Piñeiro Iglesias (IRC: infapi00) 2012-09-10 18:00:07 UTC
(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?
Comment 3 Eitan Isaacson 2012-09-10 18:02:12 UTC
GNOME Shell implements a caribou keyboard. When I meant not to be used externally, I meant by any application that needs keyboard input.
Comment 4 Jan Horak 2012-09-11 10:56:02 UTC
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
?
Comment 5 mads 2012-11-26 23:18:58 UTC
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.
Comment 6 David King 2013-06-11 14:07:12 UTC
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
Comment 7 Daiki Ueno 2013-06-17 06:52:40 UTC
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.
Comment 8 David King 2013-06-24 07:31:50 UTC
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.
Comment 9 David King 2013-07-25 11:13:40 UTC
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.
Comment 10 Daiki Ueno 2013-07-26 09:04:14 UTC
Review of attachment 250098 [details] [review]:

Looks good, thanks.
Comment 11 David King 2014-09-03 07:18:32 UTC
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.
Comment 12 Daiki Ueno 2014-09-05 02:09:31 UTC
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?
Comment 13 David King 2014-09-05 06:44:50 UTC
Review of attachment 285448 [details] [review]:

Seems fine to me.