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 613101 - [main] Use Meta.Display.lookup_keyboard_action to enable workspace switches
[main] Use Meta.Display.lookup_keyboard_action to enable workspace switches
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: 613203
Blocks:
 
 
Reported: 2010-03-17 02:19 UTC by Colin Walters
Modified: 2010-03-18 18:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[main] Use Meta.Display.lookup_keyboard_action to enable workspace switches (2.51 KB, patch)
2010-03-17 02:19 UTC, Colin Walters
reviewed Details | Review
Use Meta.Display.lookup_keyboard_action to enable workspace switches (5.09 KB, patch)
2010-03-17 23:30 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2010-03-17 02:19:53 UTC
Also refactor Alt-F2 to use this as well.
Comment 1 Colin Walters 2010-03-17 02:19:55 UTC
Created attachment 156322 [details] [review]
[main] Use Meta.Display.lookup_keyboard_action to enable workspace switches
Comment 2 Dan Winship 2010-03-17 14:27:24 UTC
Comment on attachment 156322 [details] [review]
[main] Use Meta.Display.lookup_keyboard_action to enable workspace switches

>@@ -285,6 +285,9 @@ function _globalKeyPressHandler(actor, event) {

should the comment before this function (re: "hackiness") be updated at all?

also, why can't printscreen be handled this way? (let me guess; the key is captured by g-s-d even though the screenshot command gconf key is owned by metacity?)

>+        let modifierState = event.get_state();

you can't use event.get_state(). bug 597292. Use Shell.get_event_state(event).

(The reason we never got a bug report about the old code is that it was only calling event.get_state() *after* checking "symbol == Clutter.F2", so it would only throw an exception if someone using multiple keyboard layouts tried to use the run dialog from the overview, which I guess either never happened, or else the users just assumed Alt-F2 wasn't supposed to work in the overview.)

>+        let action = display.get_keybinding_action(symbol, keyCode, modifierState);
>+        switch (action) {
>+            case Meta.KeyBindingAction.WORKSPACE_LEFT:
>+                if (activeWorkspaceIndex > 0)
>+                    global.screen.get_workspace_by_index(activeWorkspaceIndex - 1).activate(global.get_current_time());

it seems like it would be nice if we could just do "display.perform_action(action);" or something... I guess in this case we don't want the workspace switcher popup to appear, but we could just have it know to not draw itself if the overview was active. (WindowManager already has a method to test for that; _shouldAnimate().)

eg, if we decide to make the ws switcher keys obey the grid layout when that's selected, we don't want to have to put that logic both in windowManager.js and here.
Comment 3 Colin Walters 2010-03-17 23:30:28 UTC
Created attachment 156408 [details] [review]
Use Meta.Display.lookup_keyboard_action to enable workspace switches

Also refactor Alt-F2 to use this as well.
Comment 4 Dan Winship 2010-03-18 18:10:50 UTC
Comment on attachment 156408 [details] [review]
Use Meta.Display.lookup_keyboard_action to enable workspace switches

looks good
Comment 5 Colin Walters 2010-03-18 18:15:14 UTC
Attachment 156408 [details] pushed as d98db2b - Use Meta.Display.lookup_keyboard_action to enable workspace switches