Move panel-main-menu schema in house (#1409)

This commit is contained in:
David Hewitt 2022-04-22 16:00:27 +00:00 committed by GitHub
parent f9008e4f7a
commit 1e223b3027
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 4 deletions

View File

@ -155,6 +155,10 @@
<default><![CDATA[['<Super><Shift>Tab']]]></default>
<summary>Cycle to the next workspace to the right or to back to the first</summary>
</key>
<key type="as" name="panel-main-menu">
<default><![CDATA[['<Super>space','<Alt>F2']]]></default>
<summary>Open the applications menu</summary>
</key>
<key type="as" name="switch-input-source">
<default><![CDATA[['<Alt>space']]]></default>
<summary>Cycle to next keyboard layout</summary>

View File

@ -242,15 +242,16 @@ namespace Gala {
display.add_keybinding ("move-to-workspace-last", keybinding_settings, 0, (Meta.KeyHandlerFunc) handle_move_to_workspace_end);
display.add_keybinding ("cycle-workspaces-next", keybinding_settings, 0, (Meta.KeyHandlerFunc) handle_cycle_workspaces);
display.add_keybinding ("cycle-workspaces-previous", keybinding_settings, 0, (Meta.KeyHandlerFunc) handle_cycle_workspaces);
#if HAS_MUTTER41
display.add_keybinding ("panel-main-menu", keybinding_settings, 0, (Meta.KeyHandlerFunc) handle_applications_menu);
#else
Meta.KeyBinding.set_custom_handler ("panel-main-menu", (Meta.KeyHandlerFunc) handle_applications_menu);
#endif
display.overlay_key.connect (() => {
launch_action ("overlay-action");
});
Meta.KeyBinding.set_custom_handler ("panel-main-menu", () => {
launch_action ("panel-main-menu-action");
});
Meta.KeyBinding.set_custom_handler ("toggle-recording", () => {
launch_action ("toggle-recording-action");
});
@ -436,6 +437,12 @@ namespace Gala {
manager.get_workspace_by_index (index).activate (display.get_current_time ());
}
[CCode (instance_pos = -1)]
void handle_applications_menu (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) {
launch_action ("panel-main-menu-action");
}
private void on_gesture_detected (Gesture gesture) {
if (workspace_view.is_opened ()) {
return;