linuxmint / muffin

The window management library for the Cinnamon desktop (libmuffin) and its sample WM binary (muffin)
GNU General Public License v2.0
197 stars 93 forks source link

[Next] Add hotkey support for (tiling-) window switching #700

Open TobiasSchaffner opened 3 months ago

TobiasSchaffner commented 3 months ago

Despite the existing hotkey support for window tiling in Cinnamon, an efficient mechanism for navigating between the tiled windows, apart from tabbing through the list of open windows, was missing.

This patch adds support for navigation between windows using hotkeys.

TobiasSchaffner commented 3 months ago

Additional patches for testing:

cinnamon:

diff --git a/files/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py b/files/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py
index d65a9628c..5406b516c 100755
--- a/files/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py
+++ b/files/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py
@@ -114,6 +114,10 @@ KEYBINDINGS = [
     [_("Push tile right"), MUFFIN_KEYBINDINGS_SCHEMA, "push-tile-right", "win-tiling"],
     [_("Push tile up"), MUFFIN_KEYBINDINGS_SCHEMA, "push-tile-up", "win-tiling"],
     [_("Push tile down"), MUFFIN_KEYBINDINGS_SCHEMA, "push-tile-down", "win-tiling"],
+    [_("Switch to tile left"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-tile-left", "win-tiling"],
+    [_("Switch to tile right"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-tile-right", "win-tiling"],
+    [_("Switch to tile up"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-tile-up", "win-tiling"],
+    [_("Switch to tile down"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-tile-down", "win-tiling"],
     # Windows - Workspace-related
     [_("Move window to new workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "move-to-workspace-new", "win-workspaces"],
     [_("Move window to left workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "move-to-workspace-left", "win-workspaces"],

cinnamon-desktop:

diff --git a/schemas/org.cinnamon.desktop.keybindings.wm.gschema.xml.in b/schemas/org.cinnamon.desktop.keybindings.wm.gschema.xml.in
index ed9ca9d..37f3bbe 100644
--- a/schemas/org.cinnamon.desktop.keybindings.wm.gschema.xml.in
+++ b/schemas/org.cinnamon.desktop.keybindings.wm.gschema.xml.in
@@ -21,6 +21,22 @@
       <default><![CDATA[['<Super>Down']]]></default>
     </key>

+    <key type="as" name="switch-to-tile-left">
+      <default><![CDATA[['<Alt>Left']]]></default>
+    </key>
+
+    <key type="as" name="switch-to-tile-right">
+      <default><![CDATA[['<Alt>Right']]]></default>
+    </key>
+
+    <key type="as" name="switch-to-tile-up">
+      <default><![CDATA[['<Alt>Up']]]></default>
+    </key>
+
+    <key type="as" name="switch-to-tile-down">
+      <default><![CDATA[['<Alt>Down']]]></default>
+    </key>
+
     <key type="as" name="push-snap-left">
       <default>[]</default>
       <summary>obsolete</summary>
clefebvre commented 3 days ago

Marking this as NEXT. I like the idea but we're planning to look into workspace management in the near future and maybe redesign scale/overview. The design around integrated tiling features should go along with that.