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 736435 - Implement input source switching
Implement input source switching
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks: 736436
 
 
Reported: 2014-09-10 18:36 UTC by Rui Matos
Modified: 2014-09-11 17:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
status/keyboard: Move IBusManager into its own file (12.72 KB, patch)
2014-09-10 18:36 UTC, Rui Matos
committed Details | Review
status/keyboard: Factor out a KeyboardManager class (8.58 KB, patch)
2014-09-10 18:36 UTC, Rui Matos
rejected Details | Review
status/keyboard: Factor out an InputSourceManager class (22.44 KB, patch)
2014-09-10 18:36 UTC, Rui Matos
committed Details | Review
status/keyboard: Move all UI elements to the indicator class (7.96 KB, patch)
2014-09-10 18:36 UTC, Rui Matos
committed Details | Review
ibusManager: Spawn ibus-daemon (1.50 KB, patch)
2014-09-10 18:36 UTC, Rui Matos
reviewed Details | Review
Implement input source switching (15.48 KB, patch)
2014-09-10 18:36 UTC, Rui Matos
reviewed Details | Review
status/keyboard: Factor out a KeyboardManager class (7.67 KB, patch)
2014-09-11 15:02 UTC, Rui Matos
committed Details | Review
ibusManager: Spawn ibus-daemon (1.72 KB, patch)
2014-09-11 15:03 UTC, Rui Matos
committed Details | Review
Implement input source switching (13.84 KB, patch)
2014-09-11 15:04 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2014-09-10 18:36:23 UTC
These patches move the input source handling that currently happens in
gnome-settings-daemon into gnome-shell so that we can make it work
when running as a Wayland compositor using the same logic as when
running as an X compositor.
Comment 1 Rui Matos 2014-09-10 18:36:26 UTC
Created attachment 285851 [details] [review]
status/keyboard: Move IBusManager into its own file

This also makes it a singleton for easier access from multiple places.
Comment 2 Rui Matos 2014-09-10 18:36:30 UTC
Created attachment 285852 [details] [review]
status/keyboard: Factor out a KeyboardManager class

This allows us to have different implementations for X11 and
Wayland. For now, the Wayland implementation just blindly sets a
layout using a mutter API.
Comment 3 Rui Matos 2014-09-10 18:36:35 UTC
Created attachment 285853 [details] [review]
status/keyboard: Factor out an InputSourceManager class
Comment 4 Rui Matos 2014-09-10 18:36:40 UTC
Created attachment 285854 [details] [review]
status/keyboard: Move all UI elements to the indicator class

This will allow us to have multiple indicator instances, e.g. show a
indicator next to text entries in modal shell dialogs.
Comment 5 Rui Matos 2014-09-10 18:36:45 UTC
Created attachment 285855 [details] [review]
ibusManager: Spawn ibus-daemon

gnome-settings-daemon doesn't this for us anymore.
Comment 6 Rui Matos 2014-09-10 18:36:50 UTC
Created attachment 285856 [details] [review]
Implement input source switching

Instead of calling out into gnome-settings-manager we'll just
implement the switching logic ourselves and use mutter APIs that allow
this functionality to work both in X sessions and when we're a Wayland
compositor.

Switching IBus engines is done transparently as well just like g-s-d
used to do.
Comment 7 Jasper St. Pierre (not reading bugmail) 2014-09-11 00:44:20 UTC
Review of attachment 285855 [details] [review]:

Ugh. Can this not be DBus-activated?
Comment 8 Jasper St. Pierre (not reading bugmail) 2014-09-11 01:28:42 UTC
Review of attachment 285853 [details] [review]:

Sure.
Comment 9 Jasper St. Pierre (not reading bugmail) 2014-09-11 01:29:05 UTC
Review of attachment 285851 [details] [review]:

Sure.
Comment 10 Jasper St. Pierre (not reading bugmail) 2014-09-11 01:29:46 UTC
Review of attachment 285854 [details] [review]:

Sure. Seems unrelated, but sure.
Comment 11 Jasper St. Pierre (not reading bugmail) 2014-09-11 01:34:30 UTC
Review of attachment 285856 [details] [review]:

"gnome-settings-manager" should probably be "gnome-settings-daemon".

Can you replace the earlier patch in the stack which introduces KeyboardManager with this one?

::: js/misc/keyboardManager.js
@@ +141,3 @@
+
+        if (group.length > 0) {
+            layouts = group[0].layout;

I'd do this as:

let layouts = group.map(function(g) { return g.layout; }).join(',');
let variants = ...

@@ +164,3 @@
+            options = this._xkbOptions[0];
+            for (let i = 1; i < this._xkbOptions.length; ++i)
+                options += ',' + this._xkbOptions[i];

this._xkbOptions.join(',')
Comment 12 Jasper St. Pierre (not reading bugmail) 2014-09-11 01:34:47 UTC
Review of attachment 285852 [details] [review]:

We don't use any of this patch, so just get rid of it.
Comment 13 Rui Matos 2014-09-11 15:02:42 UTC
Created attachment 285922 [details] [review]
status/keyboard: Factor out a KeyboardManager class

This code will grow in a forthcoming patch so let's move it out.
--

I didn't completly remove the patch since it creates some conflicts
with the patches ahead of it but I removed the spurious stuff that
was being removed in the last patch before.
Comment 14 Rui Matos 2014-09-11 15:03:21 UTC
Created attachment 285923 [details] [review]
ibusManager: Spawn ibus-daemon

gnome-settings-daemon doesn't this for us anymore. Note that
ibus-daemon isn't DBus activatable but just spawning it is fine
because it does its own single instance management. The library
notifies us when it shows up and goes away through the connected and
disconnected signals.
--

Expanded the commit message.
Comment 15 Rui Matos 2014-09-11 15:04:20 UTC
Created attachment 285924 [details] [review]
Implement input source switching

Instead of calling out to gnome-settings-daemon we'll just implement
the switching logic ourselves and use mutter APIs that allow this
functionality to work both in X sessions and when we're a Wayland
compositor.

Switching IBus engines is done transparently as well just like g-s-d
used to do.
--

Rebased and fixed according to the review.
Comment 16 Jasper St. Pierre (not reading bugmail) 2014-09-11 15:33:21 UTC
Review of attachment 285923 [details] [review]:

I still really don't like it, but whatever. We can fix this in the future.
Comment 17 Jasper St. Pierre (not reading bugmail) 2014-09-11 15:34:54 UTC
Review of attachment 285924 [details] [review]:

Much better.
Comment 18 Jasper St. Pierre (not reading bugmail) 2014-09-11 15:35:43 UTC
Review of attachment 285922 [details] [review]:

Yep.
Comment 19 Rui Matos 2014-09-11 17:36:24 UTC
Attachment 285851 [details] pushed as 58aabfc - status/keyboard: Move IBusManager into its own file
Attachment 285853 [details] pushed as effe6fa - status/keyboard: Factor out an InputSourceManager class
Attachment 285854 [details] pushed as a0a7017 - status/keyboard: Move all UI elements to the indicator class
Attachment 285922 [details] pushed as 8e560f9 - status/keyboard: Factor out a KeyboardManager class
Attachment 285923 [details] pushed as 6a36a68 - ibusManager: Spawn ibus-daemon
Attachment 285924 [details] pushed as 8589bfb - Implement input source switching