From ef7d7ec13d232472f44907beb36270403f08d246 Mon Sep 17 00:00:00 2001 From: bbedward Date: Mon, 5 Jan 2026 13:01:10 -0500 Subject: [PATCH] desktop widgets: niri overview only option + grid on overlay when on overview --- .../Modules/Plugins/DesktopPluginWrapper.qml | 13 ++++++++++--- .../Settings/DesktopWidgetInstanceCard.qml | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/quickshell/Modules/Plugins/DesktopPluginWrapper.qml b/quickshell/Modules/Plugins/DesktopPluginWrapper.qml index f79ea423..d349bade 100644 --- a/quickshell/Modules/Plugins/DesktopPluginWrapper.qml +++ b/quickshell/Modules/Plugins/DesktopPluginWrapper.qml @@ -24,6 +24,7 @@ Item { readonly property bool showOnOverlay: instanceData?.config?.showOnOverlay ?? false readonly property bool showOnOverview: instanceData?.config?.showOnOverview ?? false + readonly property bool showOnOverviewOnly: instanceData?.config?.showOnOverviewOnly ?? false readonly property bool overviewActive: CompositorService.isNiri && NiriService.inOverview Connections { @@ -203,7 +204,13 @@ Item { PanelWindow { id: widgetWindow screen: root.screen - visible: root.widgetEnabled && root.activeComponent !== null + visible: { + if (!root.widgetEnabled || root.activeComponent === null) + return false; + if (root.showOnOverviewOnly) + return root.overviewActive; + return true; + } color: "transparent" WlrLayershell.namespace: "quickshell:desktop-widget:" + root.pluginId + (root.instanceId ? ":" + root.instanceId : "") @@ -212,7 +219,7 @@ Item { return WlrLayer.Overlay; if (root.showOnOverlay) return WlrLayer.Overlay; - if (root.showOnOverview && root.overviewActive) + if (root.overviewActive && (root.showOnOverview || root.showOnOverviewOnly)) return WlrLayer.Overlay; return WlrLayer.Bottom; } @@ -543,7 +550,7 @@ Item { mask: Region {} WlrLayershell.namespace: "quickshell:desktop-widget-grid" - WlrLayershell.layer: WlrLayer.Background + WlrLayershell.layer: root.overviewActive && (root.showOnOverview || root.showOnOverviewOnly) ? WlrLayer.Overlay : WlrLayer.Background WlrLayershell.exclusionMode: ExclusionMode.Ignore WlrLayershell.keyboardFocus: WlrKeyboardFocus.None diff --git a/quickshell/Modules/Settings/DesktopWidgetInstanceCard.qml b/quickshell/Modules/Settings/DesktopWidgetInstanceCard.qml index 35926f90..bfbe9409 100644 --- a/quickshell/Modules/Settings/DesktopWidgetInstanceCard.qml +++ b/quickshell/Modules/Settings/DesktopWidgetInstanceCard.qml @@ -246,6 +246,23 @@ SettingsCard { } } + SettingsDivider { + visible: CompositorService.isNiri + } + + SettingsToggleRow { + visible: CompositorService.isNiri + text: I18n.tr("Show on Overview Only") + checked: instanceData?.config?.showOnOverviewOnly ?? false + onToggled: isChecked => { + if (!root.instanceId) + return; + SettingsData.updateDesktopWidgetInstanceConfig(root.instanceId, { + showOnOverviewOnly: isChecked + }); + } + } + SettingsDivider {} Item {