From a97409dfd70caa3a29f95950c7b76fce018bf727 Mon Sep 17 00:00:00 2001 From: bbedward Date: Mon, 2 Feb 2026 16:29:59 -0500 Subject: [PATCH] window: freeze mask geometry in popout --- .../Modals/DankLauncherV2/Controller.qml | 2 +- .../Modules/DankBar/Popouts/BatteryPopout.qml | 2 +- quickshell/Widgets/DankPopout.qml | 42 +++++++++++++------ 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/quickshell/Modals/DankLauncherV2/Controller.qml b/quickshell/Modals/DankLauncherV2/Controller.qml index a9f2a384..21776e60 100644 --- a/quickshell/Modals/DankLauncherV2/Controller.qml +++ b/quickshell/Modals/DankLauncherV2/Controller.qml @@ -50,7 +50,7 @@ Item { Connections { target: AppSearchService - function onCacheInvalidated() { + function onCacheVersionChanged() { _clearModeCache(); } } diff --git a/quickshell/Modules/DankBar/Popouts/BatteryPopout.qml b/quickshell/Modules/DankBar/Popouts/BatteryPopout.qml index 0103ada4..5f74c41a 100644 --- a/quickshell/Modules/DankBar/Popouts/BatteryPopout.qml +++ b/quickshell/Modules/DankBar/Popouts/BatteryPopout.qml @@ -32,7 +32,7 @@ DankPopout { } popupWidth: 400 - popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 400 + popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 0 triggerWidth: 70 positioning: "" screen: triggerScreen diff --git a/quickshell/Widgets/DankPopout.qml b/quickshell/Widgets/DankPopout.qml index 8264a413..a8f9f27c 100644 --- a/quickshell/Widgets/DankPopout.qml +++ b/quickshell/Widgets/DankPopout.qml @@ -74,6 +74,12 @@ Item { property int effectiveBarPosition: 0 property real effectiveBarBottomGap: 0 + // Snapshot mask geometry to prevent background damage on bar updates + property real _frozenMaskX: 0 + property real _frozenMaskY: 0 + property real _frozenMaskWidth: 0 + property real _frozenMaskHeight: 0 + function setBarContext(position, bottomGap) { effectiveBarPosition = position !== undefined ? position : 0; effectiveBarBottomGap = bottomGap !== undefined ? bottomGap : 0; @@ -104,6 +110,12 @@ Item { return; closeTimer.stop(); + // Snapshot mask geometry + _frozenMaskX = maskX; + _frozenMaskY = maskY; + _frozenMaskWidth = maskWidth; + _frozenMaskHeight = maskHeight; + if (_lastOpenedScreen !== null && _lastOpenedScreen !== screen) { contentWindow.visible = false; if (useBackgroundWindow) @@ -236,24 +248,30 @@ Item { } mask: Region { - item: Rectangle { - x: root.maskX - y: root.maskY - width: (shouldBeVisible && backgroundInteractive) ? root.maskWidth : 0 - height: (shouldBeVisible && backgroundInteractive) ? root.maskHeight : 0 - } + item: maskRect + } + + Rectangle { + id: maskRect + visible: false + color: "transparent" + x: root._frozenMaskX + y: root._frozenMaskY + width: (shouldBeVisible && backgroundInteractive) ? root._frozenMaskWidth : 0 + height: (shouldBeVisible && backgroundInteractive) ? root._frozenMaskHeight : 0 } MouseArea { - x: root.maskX - y: root.maskY - width: root.maskWidth - height: root.maskHeight + x: root._frozenMaskX + y: root._frozenMaskY + width: root._frozenMaskWidth + height: root._frozenMaskHeight + hoverEnabled: false enabled: shouldBeVisible && backgroundInteractive acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton onClicked: mouse => { - const clickX = mouse.x + root.maskX; - const clickY = mouse.y + root.maskY; + const clickX = mouse.x + root._frozenMaskX; + const clickY = mouse.y + root._frozenMaskY; const outsideContent = clickX < root.alignedX || clickX > root.alignedX + root.alignedWidth || clickY < root.alignedY || clickY > root.alignedY + root.alignedHeight; if (!outsideContent)