Skip to content

Commit

Permalink
Have alt+tab show windows from the current monitor only
Browse files Browse the repository at this point in the history
  • Loading branch information
Petermhen committed Jan 21, 2025
1 parent 21e51b1 commit 52ef3db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/org.cinnamon.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,11 @@
<summary>Enforce displaying the alt-tab switcher on the primary monitor instead of the active one</summary>
</key>

<key type="b" name="alttab-switcher-show-current-monitor">
<default>false</default>
<summary>Show windows from current monitor only</summary>
</key>

<key type="b" name="alttab-minimized-aware">
<default>true</default>
<summary>Move minimized windows to the end of the appSwitcher</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,8 @@ def update_setting(widget, pspec):
widget = GSettingsSwitch(_("Show windows from all workspaces"), "org.cinnamon", "alttab-switcher-show-all-workspaces")
settings.add_row(widget)

widget = GSettingsSwitch(_("Show windows from current monitor"), "org.cinnamon", "alttab-switcher-show-current-monitor")
settings.add_row(widget)

widget = GSettingsSwitch(_("Warp mouse pointer to the new focused window"), "org.cinnamon", "alttab-switcher-warp-mouse-pointer")
settings.add_row(widget)
7 changes: 7 additions & 0 deletions js/ui/appSwitcher/appSwitcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ function getWindowsForBinding(binding) {

windows = windows.filter(Main.isInteresting);

//Switch between windows on the current monitor only
let showCurrentMonitorOnly = global.settings.get_boolean("alttab-switcher-show-current-monitor");

if (showCurrentMonitorOnly) {
windows = windows.filter(w => w.get_monitor() === global.screen.get_current_monitor())
}

switch (binding.get_name()) {
case 'switch-panels':
case 'switch-panels-backward':
Expand Down

0 comments on commit 52ef3db

Please sign in to comment.