Skip to content

Commit e5784ac

Browse files
authored
Have alt+tab show windows from the current monitor only (#12665)
1 parent d92e1b2 commit e5784ac

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

data/org.cinnamon.gschema.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,11 @@
431431
<summary>Enforce displaying the alt-tab switcher on the primary monitor instead of the active one</summary>
432432
</key>
433433

434+
<key type="b" name="alttab-switcher-show-current-monitor">
435+
<default>false</default>
436+
<summary>Show windows from current monitor only</summary>
437+
</key>
438+
434439
<key type="b" name="alttab-minimized-aware">
435440
<default>true</default>
436441
<summary>Move minimized windows to the end of the appSwitcher</summary>

files/usr/share/cinnamon/cinnamon-settings/modules/cs_windows.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ def update_setting(widget, pspec):
179179
widget = GSettingsSwitch(_("Show windows from all workspaces"), "org.cinnamon", "alttab-switcher-show-all-workspaces")
180180
settings.add_row(widget)
181181

182+
widget = GSettingsSwitch(_("Show windows from current monitor"), "org.cinnamon", "alttab-switcher-show-current-monitor")
183+
settings.add_row(widget)
184+
182185
widget = GSettingsSwitch(_("Warp mouse pointer to the new focused window"), "org.cinnamon", "alttab-switcher-warp-mouse-pointer")
183186
settings.add_row(widget)
184187

js/ui/appSwitcher/appSwitcher.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ function getWindowsForBinding(binding) {
6464

6565
windows = windows.filter(Main.isInteresting);
6666

67+
//Switch between windows on the current monitor only
68+
let showCurrentMonitorOnly = global.settings.get_boolean("alttab-switcher-show-current-monitor");
69+
70+
if (showCurrentMonitorOnly) {
71+
windows = windows.filter(w => w.get_monitor() === global.screen.get_current_monitor())
72+
}
73+
6774
switch (binding.get_name()) {
6875
case 'switch-panels':
6976
case 'switch-panels-backward':

0 commit comments

Comments
 (0)