Add 'switch-applications' keybinding

Add an additional "switcher" keybinding for switching between
applications rather than windows (like the existing 'switch-windows'
and 'switch-group' bindings).
The purpose of the new keybinding is to be taken over by gnome-shell's
application-based alt-tab popup, so rather than actually implementing
an application switcher in mutter, let it duplicate the normal window
switcher when run standalone.

https://bugzilla.gnome.org/show_bug.cgi?id=688913
This commit is contained in:
Florian Müllner 2012-11-23 03:48:14 +01:00
parent 8703daccbe
commit 2282326f30
3 changed files with 26 additions and 1 deletions

View File

@ -29,9 +29,12 @@
<KeyListEntry name="move-to-workspace-down" <KeyListEntry name="move-to-workspace-down"
_description="Move window one workspace down" /> _description="Move window one workspace down" />
<KeyListEntry name="switch-windows" <KeyListEntry name="switch-applications"
_description="Switch applications"/> _description="Switch applications"/>
<KeyListEntry name="switch-windows"
_description="Switch windows"/>
<KeyListEntry name="switch-group" <KeyListEntry name="switch-group"
_description="Switch windows of an application"/> _description="Switch windows of an application"/>

View File

@ -2317,8 +2317,10 @@ process_tab_grab (MetaDisplay *display,
case META_KEYBINDING_ACTION_CYCLE_WINDOWS_BACKWARD: case META_KEYBINDING_ACTION_CYCLE_WINDOWS_BACKWARD:
case META_KEYBINDING_ACTION_SWITCH_PANELS: case META_KEYBINDING_ACTION_SWITCH_PANELS:
case META_KEYBINDING_ACTION_SWITCH_WINDOWS: case META_KEYBINDING_ACTION_SWITCH_WINDOWS:
case META_KEYBINDING_ACTION_SWITCH_APPLICATIONS:
case META_KEYBINDING_ACTION_SWITCH_PANELS_BACKWARD: case META_KEYBINDING_ACTION_SWITCH_PANELS_BACKWARD:
case META_KEYBINDING_ACTION_SWITCH_WINDOWS_BACKWARD: case META_KEYBINDING_ACTION_SWITCH_WINDOWS_BACKWARD:
case META_KEYBINDING_ACTION_SWITCH_APPLICATIONS_BACKWARD:
case META_KEYBINDING_ACTION_CYCLE_GROUP: case META_KEYBINDING_ACTION_CYCLE_GROUP:
case META_KEYBINDING_ACTION_CYCLE_GROUP_BACKWARD: case META_KEYBINDING_ACTION_CYCLE_GROUP_BACKWARD:
case META_KEYBINDING_ACTION_SWITCH_GROUP: case META_KEYBINDING_ACTION_SWITCH_GROUP:
@ -2425,8 +2427,10 @@ process_tab_grab (MetaDisplay *display,
break; break;
case META_KEYBINDING_ACTION_SWITCH_PANELS: case META_KEYBINDING_ACTION_SWITCH_PANELS:
case META_KEYBINDING_ACTION_SWITCH_WINDOWS: case META_KEYBINDING_ACTION_SWITCH_WINDOWS:
case META_KEYBINDING_ACTION_SWITCH_APPLICATIONS:
case META_KEYBINDING_ACTION_SWITCH_PANELS_BACKWARD: case META_KEYBINDING_ACTION_SWITCH_PANELS_BACKWARD:
case META_KEYBINDING_ACTION_SWITCH_WINDOWS_BACKWARD: case META_KEYBINDING_ACTION_SWITCH_WINDOWS_BACKWARD:
case META_KEYBINDING_ACTION_SWITCH_APPLICATIONS_BACKWARD:
/* SWITCH_* are traditionally Tab-based actions, /* SWITCH_* are traditionally Tab-based actions,
* and should cancel traditionally Escape-based ones. * and should cancel traditionally Escape-based ones.
*/ */
@ -2497,11 +2501,13 @@ process_tab_grab (MetaDisplay *display,
break; break;
case META_KEYBINDING_ACTION_SWITCH_PANELS: case META_KEYBINDING_ACTION_SWITCH_PANELS:
case META_KEYBINDING_ACTION_SWITCH_WINDOWS: case META_KEYBINDING_ACTION_SWITCH_WINDOWS:
case META_KEYBINDING_ACTION_SWITCH_APPLICATIONS:
case META_KEYBINDING_ACTION_SWITCH_GROUP: case META_KEYBINDING_ACTION_SWITCH_GROUP:
key_used = TRUE; key_used = TRUE;
break; break;
case META_KEYBINDING_ACTION_SWITCH_PANELS_BACKWARD: case META_KEYBINDING_ACTION_SWITCH_PANELS_BACKWARD:
case META_KEYBINDING_ACTION_SWITCH_WINDOWS_BACKWARD: case META_KEYBINDING_ACTION_SWITCH_WINDOWS_BACKWARD:
case META_KEYBINDING_ACTION_SWITCH_APPLICATIONS_BACKWARD:
case META_KEYBINDING_ACTION_SWITCH_GROUP_BACKWARD: case META_KEYBINDING_ACTION_SWITCH_GROUP_BACKWARD:
key_used = TRUE; key_used = TRUE;
backward = TRUE; backward = TRUE;
@ -3796,6 +3802,20 @@ init_builtin_key_bindings (MetaDisplay *display)
META_KEYBINDING_ACTION_SWITCH_GROUP_BACKWARD, META_KEYBINDING_ACTION_SWITCH_GROUP_BACKWARD,
handle_switch, META_TAB_LIST_GROUP); handle_switch, META_TAB_LIST_GROUP);
add_builtin_keybinding (display,
"switch-applications",
common_keybindings,
META_KEY_BINDING_REVERSES,
META_KEYBINDING_ACTION_SWITCH_APPLICATIONS,
handle_switch, META_TAB_LIST_NORMAL);
add_builtin_keybinding (display,
"switch-applications-backward",
common_keybindings,
REVERSES_AND_REVERSED,
META_KEYBINDING_ACTION_SWITCH_APPLICATIONS_BACKWARD,
handle_switch, META_TAB_LIST_NORMAL);
add_builtin_keybinding (display, add_builtin_keybinding (display,
"switch-windows", "switch-windows",
common_keybindings, common_keybindings,

View File

@ -160,6 +160,8 @@ typedef enum _MetaKeyBindingAction
META_KEYBINDING_ACTION_WORKSPACE_RIGHT, META_KEYBINDING_ACTION_WORKSPACE_RIGHT,
META_KEYBINDING_ACTION_WORKSPACE_UP, META_KEYBINDING_ACTION_WORKSPACE_UP,
META_KEYBINDING_ACTION_WORKSPACE_DOWN, META_KEYBINDING_ACTION_WORKSPACE_DOWN,
META_KEYBINDING_ACTION_SWITCH_APPLICATIONS,
META_KEYBINDING_ACTION_SWITCH_APPLICATIONS_BACKWARD,
META_KEYBINDING_ACTION_SWITCH_GROUP, META_KEYBINDING_ACTION_SWITCH_GROUP,
META_KEYBINDING_ACTION_SWITCH_GROUP_BACKWARD, META_KEYBINDING_ACTION_SWITCH_GROUP_BACKWARD,
META_KEYBINDING_ACTION_SWITCH_WINDOWS, META_KEYBINDING_ACTION_SWITCH_WINDOWS,