From 2d3706321ade1319755dc40b8fd0d16fa5cff51d Mon Sep 17 00:00:00 2001 From: bbedward Date: Thu, 30 Jul 2026 15:30:26 -0400 Subject: [PATCH] frame: fix popout IPCs in some situations related #2956 --- quickshell/DMSShellIPC.qml | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/quickshell/DMSShellIPC.qml b/quickshell/DMSShellIPC.qml index da0032467..3b495eb91 100644 --- a/quickshell/DMSShellIPC.qml +++ b/quickshell/DMSShellIPC.qml @@ -25,32 +25,30 @@ Item { required property var windowRuleModalLoader function getPreferredBar(refPropertyName) { - if (!root.dankBarRepeater || root.dankBarRepeater.count === 0) - return null; - const focusedScreenName = BarWidgetService.getFocusedScreenName(); - const loaders = Array.from({ - length: root.dankBarRepeater.count - }, (_, i) => root.dankBarRepeater.itemAt(i)); + const bars = []; + if (root.dankBarRepeater) { + for (let i = 0; i < root.dankBarRepeater.count; i++) + bars.push(...(root.dankBarRepeater.itemAt(i)?.item?.barVariants?.instances || [])); + } + const frameBars = BarWidgetService.frameHostedBars; + for (const screenName in frameBars) + bars.push(frameBars[screenName]); let currentBar = null; + for (const bar of bars) { + if (!bar) + continue; - for (const loader of loaders) { - const instances = loader?.item?.barVariants?.instances || []; - for (const bar of instances) { - if (!bar) - continue; + const onFocusedScreen = focusedScreenName && bar.modelData?.name === focusedScreenName; + const hasRef = !refPropertyName || !!bar[refPropertyName]; - const onFocusedScreen = focusedScreenName && bar.modelData?.name === focusedScreenName; - const hasRef = !refPropertyName || !!bar[refPropertyName]; + if (hasRef) { + currentBar = bar; - if (hasRef) { - currentBar = bar; - - if (onFocusedScreen) - break; - } + if (onFocusedScreen) + break; } }