GNOME Bugzilla – Bug 613101
[main] Use Meta.Display.lookup_keyboard_action to enable workspace switches
Last modified: 2010-03-18 18:15:18 UTC
Also refactor Alt-F2 to use this as well.
Created attachment 156322 [details] [review] [main] Use Meta.Display.lookup_keyboard_action to enable workspace switches
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.
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 on attachment 156408 [details] [review] Use Meta.Display.lookup_keyboard_action to enable workspace switches looks good
Attachment 156408 [details] pushed as d98db2b - Use Meta.Display.lookup_keyboard_action to enable workspace switches