gala/SOURCES/1e223b3.patch

64 lines
2.8 KiB
Diff

From 1e223b3027913e64e61278509390ed13bfe7affa Mon Sep 17 00:00:00 2001
From: David Hewitt <davidmhewitt@users.noreply.github.com>
Date: Fri, 22 Apr 2022 16:00:27 +0000
Subject: [PATCH] Move panel-main-menu schema in house (#1409)
---
data/gala.gschema.xml | 4 ++++
src/WindowManager.vala | 15 +++++++++++----
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/data/gala.gschema.xml b/data/gala.gschema.xml
index 97ba140f..684c1dd8 100644
--- a/data/gala.gschema.xml
+++ b/data/gala.gschema.xml
@@ -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>
diff --git a/src/WindowManager.vala b/src/WindowManager.vala
index 90a67b18..2a38dc69 100644
--- a/src/WindowManager.vala
+++ b/src/WindowManager.vala
@@ -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;