diff --git a/quickshell/Common/SettingsData.qml b/quickshell/Common/SettingsData.qml index cece823a..f14783b7 100644 --- a/quickshell/Common/SettingsData.qml +++ b/quickshell/Common/SettingsData.qml @@ -1974,14 +1974,6 @@ Singleton { return Quickshell.screens.filter(screen => isScreenInPreferences(screen, prefs)); } - function getFrameScreensAlways() { - const prefs = frameScreenPreferences; - if (!prefs || prefs.length === 0 || prefs.includes("all")) { - return Quickshell.screens; - } - return Quickshell.screens.filter(s => prefs.includes(s.name)); - } - function getActiveBarEdgeForScreen(screen) { if (!screen) return ""; for (var i = 0; i < barConfigs.length; i++) { diff --git a/quickshell/Modules/Frame/Frame.qml b/quickshell/Modules/Frame/Frame.qml index 2d82e3c1..b84b3c37 100644 --- a/quickshell/Modules/Frame/Frame.qml +++ b/quickshell/Modules/Frame/Frame.qml @@ -7,10 +7,10 @@ import qs.Common Variants { id: root - model: SettingsData.getFrameScreensAlways() + model: Quickshell.screens FrameInstance { - required property ShellScreen modelData + required property var modelData screen: modelData } diff --git a/quickshell/Modules/Frame/FrameExclusions.qml b/quickshell/Modules/Frame/FrameExclusions.qml index 326acfa0..fed46062 100644 --- a/quickshell/Modules/Frame/FrameExclusions.qml +++ b/quickshell/Modules/Frame/FrameExclusions.qml @@ -8,7 +8,7 @@ import qs.Common Scope { id: root - required property ShellScreen screen + required property var screen readonly property var barEdges: { SettingsData.barConfigs; // force re-eval when bar configs change @@ -18,10 +18,12 @@ Scope { // One thin invisible PanelWindow per edge. // Skips any edge where a bar already provides its own exclusiveZone. + readonly property bool screenEnabled: SettingsData.frameEnabled && SettingsData.isScreenInPreferences(root.screen, SettingsData.frameScreenPreferences) + Loader { - active: SettingsData.frameEnabled && !root.barEdges.includes("top") + active: root.screenEnabled && !root.barEdges.includes("top") sourceComponent: EdgeExclusion { - screen: root.screen + targetScreen: root.screen anchorTop: true anchorLeft: true anchorRight: true @@ -29,9 +31,9 @@ Scope { } Loader { - active: SettingsData.frameEnabled && !root.barEdges.includes("bottom") + active: root.screenEnabled && !root.barEdges.includes("bottom") sourceComponent: EdgeExclusion { - screen: root.screen + targetScreen: root.screen anchorBottom: true anchorLeft: true anchorRight: true @@ -39,9 +41,9 @@ Scope { } Loader { - active: SettingsData.frameEnabled && !root.barEdges.includes("left") + active: root.screenEnabled && !root.barEdges.includes("left") sourceComponent: EdgeExclusion { - screen: root.screen + targetScreen: root.screen anchorLeft: true anchorTop: true anchorBottom: true @@ -49,9 +51,9 @@ Scope { } Loader { - active: SettingsData.frameEnabled && !root.barEdges.includes("right") + active: root.screenEnabled && !root.barEdges.includes("right") sourceComponent: EdgeExclusion { - screen: root.screen + targetScreen: root.screen anchorRight: true anchorTop: true anchorBottom: true @@ -59,7 +61,9 @@ Scope { } component EdgeExclusion: PanelWindow { - required property ShellScreen screen + required property var targetScreen + + screen: targetScreen property bool anchorTop: false property bool anchorBottom: false property bool anchorLeft: false diff --git a/quickshell/Modules/Frame/FrameInstance.qml b/quickshell/Modules/Frame/FrameInstance.qml index c883d630..bb434a8a 100644 --- a/quickshell/Modules/Frame/FrameInstance.qml +++ b/quickshell/Modules/Frame/FrameInstance.qml @@ -6,10 +6,10 @@ import Quickshell Item { id: root - required property ShellScreen screen + required property var screen FrameWindow { - screen: root.screen + targetScreen: root.screen } FrameExclusions { diff --git a/quickshell/Modules/Frame/FrameWindow.qml b/quickshell/Modules/Frame/FrameWindow.qml index ff231371..0786432f 100644 --- a/quickshell/Modules/Frame/FrameWindow.qml +++ b/quickshell/Modules/Frame/FrameWindow.qml @@ -8,7 +8,10 @@ import qs.Common PanelWindow { id: win - required property ShellScreen screen + required property var targetScreen + + screen: targetScreen + visible: true WlrLayershell.namespace: "dms:frame" WlrLayershell.layer: WlrLayer.Top @@ -28,7 +31,7 @@ PanelWindow { FrameBorder { anchors.fill: parent - visible: SettingsData.frameEnabled + visible: SettingsData.frameEnabled && SettingsData.isScreenInPreferences(win.screen, SettingsData.frameScreenPreferences) barEdges: { SettingsData.barConfigs; return SettingsData.getActiveBarEdgesForScreen(win.screen); } } } diff --git a/quickshell/Modules/Settings/Widgets/SettingsDisplayPicker.qml b/quickshell/Modules/Settings/Widgets/SettingsDisplayPicker.qml index ba453fdc..ab4074f8 100644 --- a/quickshell/Modules/Settings/Widgets/SettingsDisplayPicker.qml +++ b/quickshell/Modules/Settings/Widgets/SettingsDisplayPicker.qml @@ -83,7 +83,6 @@ Item { description: modelData.width + "×" + modelData.height checked: localChecked onToggled: isChecked => { - localChecked = isChecked; var prefs = JSON.parse(JSON.stringify(root.displayPreferences)); if (!Array.isArray(prefs) || prefs.includes("all")) prefs = []; @@ -94,6 +93,11 @@ Item { model: modelData.model || "" }); } + if (prefs.length === 0) { + localChecked = true; + return; + } + localChecked = isChecked; root.preferencesChanged(prefs); } }