Skip to content

Commit 0cd9637

Browse files
authored
Add toggle-multitasking-view shortcut (#2309)
1 parent 401c10e commit 0cd9637

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

data/gala.gschema.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@
194194
<summary>Cycle to previous keyboard layout</summary>
195195
<description></description>
196196
</key>
197+
<key type="as" name="toggle-multitasking-view">
198+
<default><![CDATA[['<Super>Down','<Super>s']]]></default>
199+
<summary>Toggle multitasking view</summary>
200+
<description></description>
201+
</key>
197202
<key type="as" name="pip">
198203
<default><![CDATA[['<Super>f']]]></default>
199204
<summary>The shortcut to enable picture-in-picture window</summary>

src/WindowManager.vala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,14 @@ namespace Gala {
297297
display.add_keybinding ("cycle-workspaces-previous", keybinding_settings, Meta.KeyBindingFlags.NONE, (Meta.KeyHandlerFunc) handle_cycle_workspaces);
298298
display.add_keybinding ("panel-main-menu", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_applications_menu);
299299

300+
display.add_keybinding ("toggle-multitasking-view", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, () => {
301+
if (multitasking_view.is_opened ()) {
302+
multitasking_view.close ();
303+
} else {
304+
multitasking_view.open ();
305+
}
306+
});
307+
300308
display.add_keybinding ("expose-all-windows", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, () => {
301309
if (window_overview.is_opened ()) {
302310
window_overview.close ();
@@ -313,14 +321,6 @@ namespace Gala {
313321
launch_action (ActionKeys.TOGGLE_RECORDING_ACTION);
314322
});
315323

316-
Meta.KeyBinding.set_custom_handler ("show-desktop", () => {
317-
if (multitasking_view.is_opened ()) {
318-
multitasking_view.close ();
319-
} else {
320-
multitasking_view.open ();
321-
}
322-
});
323-
324324
Meta.KeyBinding.set_custom_handler ("switch-to-workspace-up", () => {});
325325
Meta.KeyBinding.set_custom_handler ("switch-to-workspace-down", () => {});
326326
Meta.KeyBinding.set_custom_handler ("switch-to-workspace-left", (Meta.KeyHandlerFunc) handle_switch_to_workspace);
@@ -1715,8 +1715,6 @@ namespace Gala {
17151715
case Meta.KeyBindingAction.WORKSPACE_LEFT:
17161716
case Meta.KeyBindingAction.WORKSPACE_RIGHT:
17171717
return filter_action (SWITCH_WORKSPACE);
1718-
case Meta.KeyBindingAction.SHOW_DESKTOP:
1719-
return filter_action (MULTITASKING_VIEW);
17201718
case Meta.KeyBindingAction.SWITCH_APPLICATIONS:
17211719
case Meta.KeyBindingAction.SWITCH_APPLICATIONS_BACKWARD:
17221720
case Meta.KeyBindingAction.SWITCH_WINDOWS:
@@ -1737,6 +1735,8 @@ namespace Gala {
17371735
case "zoom-in":
17381736
case "zoom-out":
17391737
return filter_action (ZOOM);
1738+
case "toggle-multitasking-view":
1739+
return filter_action (MULTITASKING_VIEW);
17401740
default:
17411741
break;
17421742
}

0 commit comments

Comments
 (0)