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 682315 - input sources: add an OSD for cycling through engines
input sources: add an OSD for cycling through engines
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on: 682318
Blocks: 690106
 
 
Reported: 2012-08-21 01:13 UTC by Matthias Clasen
Modified: 2013-02-16 09:28 UTC
See Also:
GNOME target: 3.8
GNOME version: ---


Attachments
keybindings: Give dynamic keybindings a keybindings action (5.18 KB, patch)
2012-12-12 13:08 UTC, Rui Matos
committed Details | Review
main: Add an ALL value to KeybindingMode (699 bytes, patch)
2012-12-12 13:08 UTC, Rui Matos
committed Details | Review
main: Init WindowManager before Panel (974 bytes, patch)
2012-12-12 13:09 UTC, Rui Matos
reviewed Details | Review
windowManager: Return the KeyBindingAction value from addKeybinding() (1.00 KB, patch)
2012-12-12 13:09 UTC, Rui Matos
committed Details | Review
Add the new switch-input-source keybinding (2.46 KB, patch)
2012-12-12 13:09 UTC, Rui Matos
committed Details | Review
status/keyboard: Keep a list of input sources in MRU order (5.04 KB, patch)
2012-12-12 13:09 UTC, Rui Matos
committed Details | Review
status/keyboard: Add an Alt+Tab like input source switcher (5.99 KB, patch)
2012-12-12 13:09 UTC, Rui Matos
accepted-commit_now Details | Review
main: Initialize WindowManager earlier (1.24 KB, patch)
2012-12-13 09:22 UTC, Rui Matos
committed Details | Review
status/keyboard: Add an Alt+Tab like input source switcher (6.06 KB, patch)
2012-12-13 09:33 UTC, Rui Matos
committed Details | Review
Screenshot (266.62 KB, image/jpeg)
2012-12-13 12:53 UTC, Rui Matos
  Details

Description Matthias Clasen 2012-08-21 01:13:00 UTC
Takao demonstrated the OSD-approach that ibus uses for switching engines during the input sources bof at guadec, and we agreed that this is a good idea.
Comment 1 Rui Matos 2012-12-12 13:08:07 UTC
Created attachment 231357 [details] [review]
keybindings: Give dynamic keybindings a keybindings action

--
This is a patch from Florian needed for the shell side. I massaged it
a bit to apply to current master.
Comment 2 Rui Matos 2012-12-12 13:08:52 UTC
Created attachment 231358 [details] [review]
main: Add an ALL value to KeybindingMode
Comment 3 Rui Matos 2012-12-12 13:09:09 UTC
Created attachment 231359 [details] [review]
main: Init WindowManager before Panel

This allows us to register keybindings from the panel or any status
indicator.
Comment 4 Rui Matos 2012-12-12 13:09:18 UTC
Created attachment 231360 [details] [review]
windowManager: Return the KeyBindingAction value from addKeybinding()
Comment 5 Rui Matos 2012-12-12 13:09:24 UTC
Created attachment 231361 [details] [review]
Add the new switch-input-source keybinding
Comment 6 Rui Matos 2012-12-12 13:09:29 UTC
Created attachment 231362 [details] [review]
status/keyboard: Keep a list of input sources in MRU order

This will allows us to provide an Alt+Tab like input source switcher.
Comment 7 Rui Matos 2012-12-12 13:09:43 UTC
Created attachment 231363 [details] [review]
status/keyboard: Add an Alt+Tab like input source switcher
Comment 8 Rui Matos 2012-12-12 13:12:16 UTC
Patch "status/keyboard: Keep IBus properties per engine" in bug 682318 is a requirement for this.
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-12-12 20:35:58 UTC
Review of attachment 231359 [details] [review]:

Any reason the WM isn't first? Then we can register keybindings from anywhere.
Comment 10 Jasper St. Pierre (not reading bugmail) 2012-12-12 20:37:50 UTC
Review of attachment 231357 [details] [review]:

Why did you remove #MetaKeyBindingAction?

::: src/core/keybindings.c
@@ +663,3 @@
  * @mask: Event mask
  *
+ * Get the keybinding action bound to %keycode. Builtin keybindings

just noticed, but this documentation is incorrect.
Comment 11 Jasper St. Pierre (not reading bugmail) 2012-12-12 21:18:55 UTC
Review of attachment 231358 [details] [review]:

A better commit message would be nice.
Comment 12 Jasper St. Pierre (not reading bugmail) 2012-12-12 21:19:30 UTC
Review of attachment 231360 [details] [review]:

A better commit message would be nice.

::: js/ui/windowManager.js
@@ +193,3 @@
     addKeybinding: function(name, settings, flags, modes, handler) {
+        let action;
+        action = global.display.add_keybinding(name, settings, flags, handler);

let action =
Comment 13 Jasper St. Pierre (not reading bugmail) 2012-12-12 21:19:45 UTC
Review of attachment 231361 [details] [review]:

OK.
Comment 14 Jasper St. Pierre (not reading bugmail) 2012-12-12 21:20:20 UTC
Review of attachment 231362 [details] [review]:

Sure.
Comment 15 Jasper St. Pierre (not reading bugmail) 2012-12-12 21:27:53 UTC
Review of attachment 231363 [details] [review]:

::: js/ui/status/keyboard.js
@@ +251,3 @@
+    _initialSelection: function(backward, binding) {
+        if (binding == 'switch-input-source') {
+            if (backward)

I think we need to fix these shenanigans, but maybe now is not the time.

@@ +340,3 @@
+            Main.wm.addKeybinding('switch-input-source-backward',
+                                  new Gio.Settings({ schema: "org.gnome.shell.keybindings" }),
+                                  Meta.KeyBindingFlags.REVERSES,

Isn't there also a REVERSED flag you need to add?
Comment 16 Matthias Clasen 2012-12-12 23:42:27 UTC
Review of attachment 231362 [details] [review]:

Typo in the commit message: either 'this will allow us' or 'this allows us'
Comment 17 Matthias Clasen 2012-12-13 00:35:37 UTC
hmm, couldn't get this to apply to master - am I missing some other patches ?
Comment 18 Rui Matos 2012-12-13 09:05:29 UTC
(In reply to comment #10)
> Why did you remove #MetaKeyBindingAction?

I guess that's because the function isn't returning a MetaKeyBindingAction anymore but a plain guint.

> ::: src/core/keybindings.c
> @@ +663,3 @@
>   * @mask: Event mask
>   *
> + * Get the keybinding action bound to %keycode. Builtin keybindings
> 
> just noticed, but this documentation is incorrect.

What's wrong with it?
Comment 19 Rui Matos 2012-12-13 09:16:45 UTC
(In reply to comment #11)
> A better commit message would be nice.

Got any suggestions? It seems really straightforward to me.
Comment 20 Rui Matos 2012-12-13 09:22:16 UTC
Created attachment 231454 [details] [review]
main: Initialize WindowManager earlier

--
(In reply to comment #9)
> Any reason the WM isn't first? Then we can register keybindings from anywhere.

Without suffling more code around this is as earlier as we can
go. Only Overview, CtrlAltTabManager, XdndHandler and LayoutManager
are before WM now. From those, I think only the Overview could make
sense to be after WM but since the Overview already has a 2 step init
process exactly because of other places wanting to hook to it on their
own _init()s I think it's ok to leave it like this.
Comment 21 Rui Matos 2012-12-13 09:33:49 UTC
Created attachment 231456 [details] [review]
status/keyboard: Add an Alt+Tab like input source switcher

--
(In reply to comment #15)
> +    _initialSelection: function(backward, binding) {
> +        if (binding == 'switch-input-source') {
> +            if (backward)
>
> I think we need to fix these shenanigans, but maybe now is not the time.

I agree. As far as I'm concened we could get rid of all the *-backward
keybindings. REVERSES should be enough. As it is you can have e.g.:

'<Super>space' on switch-input-source
'<Super>i' on switch-input-source-backward

1.a) Super+space goes forward
1.b) Shift+Super+space goes backward

2.a) Super+i goes backward
2.b) Shift+Super+i goes forward

And the same thing for all the other *-backward keybindings...

> @@ +340,3 @@
> +            Main.wm.addKeybinding('switch-input-source-backward',
> +                                  new Gio.Settings({ schema:
> "org.gnome.shell.keybindings" }),
> +                                  Meta.KeyBindingFlags.REVERSES,
>
> Isn't there also a REVERSED flag you need to add?

Yes, thanks for catching.
Comment 22 Rui Matos 2012-12-13 09:36:44 UTC
Fixed the other comments and typos locally.
Comment 23 Rui Matos 2012-12-13 12:53:12 UTC
Created attachment 231469 [details]
Screenshot

(In reply to comment #17)
> hmm, couldn't get this to apply to master - am I missing some other patches ?

All the patches here should go on top of the ones in bug 682318. The correct order should be:

* main: Add an ALL value to KeybindingMode
* main: Initialize WindowManager earlier
* windowManager: Return the KeyBindingAction value from addKeybinding()
* Add the new switch-input-source keybinding
* status/keyboard: Keep a list of input sources in MRU order
* status/keyboard: Add an Alt+Tab like input source switcher

Anyway, here's a screenshot of how it looks.
Comment 24 Jasper St. Pierre (not reading bugmail) 2012-12-13 14:27:23 UTC
(In reply to comment #18)
> (In reply to comment #10)
> > Why did you remove #MetaKeyBindingAction?
> 
> I guess that's because the function isn't returning a MetaKeyBindingAction
> anymore but a plain guint.

Ah right, it's an enum and introspection can't handle that.

> > ::: src/core/keybindings.c
> > @@ +663,3 @@
> >   * @mask: Event mask
> >   *
> > + * Get the keybinding action bound to %keycode. Builtin keybindings
> > 
> > just noticed, but this documentation is incorrect.
> 
> What's wrong with it?

It should be @keycode
Comment 25 Jasper St. Pierre (not reading bugmail) 2012-12-13 14:27:49 UTC
Review of attachment 231454 [details] [review]:

OK.
Comment 26 Jasper St. Pierre (not reading bugmail) 2012-12-13 14:28:16 UTC
Review of attachment 231456 [details] [review]:

OK.
Comment 27 Rui Matos 2012-12-13 17:04:59 UTC
(In reply to comment #24)
> > > ::: src/core/keybindings.c
> > > @@ +663,3 @@
> > >   * @mask: Event mask
> > >   *
> > > + * Get the keybinding action bound to %keycode. Builtin keybindings
> > > 
> > > just noticed, but this documentation is incorrect.
> > 
> > What's wrong with it?
> 
> It should be @keycode

Gotcha, thanks. Is this patch a-c-n with this amended?
Comment 28 Jasper St. Pierre (not reading bugmail) 2012-12-13 18:38:24 UTC
Review of attachment 231357 [details] [review]:

Yes
Comment 29 Rui Matos 2012-12-17 11:59:08 UTC
Attachment 231358 [details] pushed as a42d35d - main: Add an ALL value to KeybindingMode
Attachment 231360 [details] pushed as b767849 - windowManager: Return the KeyBindingAction value from addKeybinding()
Attachment 231361 [details] pushed as 88a9b76 - Add the new switch-input-source keybinding
Attachment 231362 [details] pushed as 6eef830 - status/keyboard: Keep a list of input sources in MRU order
Attachment 231454 [details] pushed as a9ec8a3 - main: Initialize WindowManager earlier
Attachment 231456 [details] pushed as f615482 - status/keyboard: Add an Alt+Tab like input source switcher
Comment 30 Rui Matos 2012-12-17 12:34:58 UTC
Attachment 231357 [details] pushed as d78de37 - keybindings: Give dynamic keybindings a keybindings action