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 688149 - allow clients to request arbitary keyboard layout
allow clients to request arbitary keyboard layout
Status: RESOLVED OBSOLETE
Product: caribou
Classification: Applications
Component: default
git master
Other All
: Normal normal
: ---
Assigned To: caribou-maint
caribou-maint
Depends on: 688218
Blocks:
 
 
Reported: 2012-11-12 09:50 UTC by Daiki Ueno
Modified: 2021-05-25 17:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
daemon: port to Vala (49.24 KB, patch)
2012-11-12 09:50 UTC, Daiki Ueno
none Details | Review
Move keyboard layout tracking from libcaribou to caribou-daemon (17.13 KB, patch)
2012-11-12 09:50 UTC, Daiki Ueno
none Details | Review
Move keyboard layout tracking from libcaribou to caribou-daemon (17.19 KB, patch)
2012-11-13 03:29 UTC, Daiki Ueno
none Details | Review

Description Daiki Ueno 2012-11-12 09:50:17 UTC
Currently libcaribou's layout switching mechanism relies on the system settings, which is good enough for European languages.  However, in some cases (CJK for example) clients may want different layout than system.  This series of patches add a D-Bus method that allows clients to explicitly specify the layout.

The first patch rewrites caribou-daemon in Vala.  This is necessary because gdk_window_add_filter (which is needed to handle libxklavier event) is not easily accessible from Python (bug 688040).

The second patch moves libxklavier event handling from libcaribou to caribou-daemon.  When the system layout changes, caribou-daemon calls the D-Bus method to request the layout.
Comment 1 Daiki Ueno 2012-11-12 09:50:19 UTC
Created attachment 228765 [details] [review]
daemon: port to Vala
Comment 2 Daiki Ueno 2012-11-12 09:50:21 UTC
Created attachment 228766 [details] [review]
Move keyboard layout tracking from libcaribou to caribou-daemon

Add a D-Bus method SetGroup to KeyboardService, which allows
clients to explicitly request arbitrary keyboard layout.
caribou-daemon detects keyboard layout changes by itself using
libxklavier and call SetGroup.
Comment 3 Eitan Isaacson 2012-11-12 18:55:24 UTC
(In reply to comment #1)
> Created an attachment (id=228765) [details] [review]
> daemon: port to Vala

I think this deserves a bug of its own, and this bug should depend on it.
Comment 4 Eitan Isaacson 2012-11-12 18:57:52 UTC
(In reply to comment #2)
> Created an attachment (id=228766) [details] [review]
> Move keyboard layout tracking from libcaribou to caribou-daemon
> 
> Add a D-Bus method SetGroup to KeyboardService, which allows
> clients to explicitly request arbitrary keyboard layout.
> caribou-daemon detects keyboard layout changes by itself using
> libxklavier and call SetGroup.

Looks good. Maybe there should b a special argument to set_group, or another method that puts the keyboard back in "auto" mode where it respects the system setting.

Also, maybe there is a way to interrogate the current IM as to what language is being used, and automatically switch Caribou. On second thought, would there even be an active IM in the case when there is no hardware keyboard?
Comment 5 Daiki Ueno 2012-11-13 03:24:40 UTC
(In reply to comment #3)
> (In reply to comment #1)
> > Created an attachment (id=228765) [details] [review] [details] [review]
> > daemon: port to Vala
> 
> I think this deserves a bug of its own, and this bug should depend on it.

Sure.  Filed as bug 688218.
Comment 6 Daiki Ueno 2012-11-13 03:29:38 UTC
Created attachment 228852 [details] [review]
Move keyboard layout tracking from libcaribou to caribou-daemon

Rebased against bug 688218.  Not addressed comment 4 yet.
Comment 7 Daiki Ueno 2012-11-13 06:41:26 UTC
(In reply to comment #4)
> Looks good. Maybe there should b a special argument to set_group, or
> another method that puts the keyboard back in "auto" mode where it
> respects the system setting.

Well, perhaps icbw, I can't imagine a use-case of the "auto" mode in
libcaribou.

With this patch, caribou-daemon will watch the system setting and
applies it to antler or gnome-shell OSK through set_group call.  So, isn't
it sufficient to keep caribou-daemon running?

Yes, it watches AT-SPI events too.  So one idea is to add an option to
caribou-daemon to watch only keyboard settings.

> Also, maybe there is a way to interrogate the current IM as to what
> language is being used, and automatically switch Caribou. On second
> thought, would there even be an active IM in the case when there is
> no hardware keyboard?

Afaik, there is no easy way to get the language through the active IM from
caribou-daemon or libcaribou, since modern IM are implemented as
framework which may host several language engines.

But nowadays, gnome-settings-daemon handles all the XKB/IM swiches[1].
I'm currently thinking of adding a set_group call in
gnome-settings-daemon itself.

Footnotes: 
[1]  https://live.gnome.org/ThreePointFive/Features/IBus
Comment 8 Daiki Ueno 2013-02-17 07:18:01 UTC
Although bug 688218 has landed, I think it would be safer to postpone this after 3.8.  Instead, I'll try to handle X-config-change event in libcaribou, so it can work with GNOME 3.6 XKB handling.  Will file a patch soon.
Comment 9 André Klapper 2021-05-25 17:46:25 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new enhancement request ticket at
  https://gitlab.gnome.org/GNOME/caribou/-/issues/

Thank you for your understanding and your help.