Sync alt-tab menu with isolate workspaces settings

gh-2298
This commit is contained in:
Charles Gagnon
2025-04-04 12:16:26 -04:00
parent 3819a852fc
commit 2974ce64d9

View File

@@ -35,6 +35,7 @@ import * as Utils from './utils.js'
import * as DesktopIconsIntegration from './desktopIconsIntegration.js'
import { DTP_EXTENSION, SETTINGS, tracker } from './extension.js'
import Gio from 'gi://Gio'
import GLib from 'gi://GLib'
import GObject from 'gi://GObject'
import Clutter from 'gi://Clutter'
@@ -100,6 +101,8 @@ export const PanelManager = class {
if (reset) return
this._syncAppSwitcherWorkspaceIsolation()
this.notificationsMonitor = new NotificationsMonitor()
this._desktopIconsUsableArea =
@@ -265,6 +268,11 @@ export const PanelManager = class {
})
},
],
[
SETTINGS,
'changed::isolate-workspaces',
this._syncAppSwitcherWorkspaceIsolation,
],
[
Utils.DisplayWrapper.getMonitorManager(),
'monitors-changed',
@@ -406,6 +414,18 @@ export const PanelManager = class {
this._desktopIconsUsableArea = null
}
_syncAppSwitcherWorkspaceIsolation() {
// alt-tab menu
let appSwitcherSettings = new Gio.Settings({
schema_id: 'org.gnome.shell.app-switcher',
})
appSwitcherSettings.set_boolean(
'current-workspace-only',
SETTINGS.get_boolean('isolate-workspaces'),
)
}
_setDesktopIconsMargins() {
this._desktopIconsUsableArea?.resetMargins()
this.allPanels.forEach((p) => {