1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-08 06:28:27 -04:00

frame: fix popout IPCs in some situations

related #2956
This commit is contained in:
bbedward
2026-07-30 15:30:26 -04:00
parent 5bb884db57
commit 2d3706321a
+17 -19
View File
@@ -25,32 +25,30 @@ Item {
required property var windowRuleModalLoader required property var windowRuleModalLoader
function getPreferredBar(refPropertyName) { function getPreferredBar(refPropertyName) {
if (!root.dankBarRepeater || root.dankBarRepeater.count === 0)
return null;
const focusedScreenName = BarWidgetService.getFocusedScreenName(); const focusedScreenName = BarWidgetService.getFocusedScreenName();
const loaders = Array.from({ const bars = [];
length: root.dankBarRepeater.count if (root.dankBarRepeater) {
}, (_, i) => root.dankBarRepeater.itemAt(i)); 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; let currentBar = null;
for (const bar of bars) {
if (!bar)
continue;
for (const loader of loaders) { const onFocusedScreen = focusedScreenName && bar.modelData?.name === focusedScreenName;
const instances = loader?.item?.barVariants?.instances || []; const hasRef = !refPropertyName || !!bar[refPropertyName];
for (const bar of instances) {
if (!bar)
continue;
const onFocusedScreen = focusedScreenName && bar.modelData?.name === focusedScreenName; if (hasRef) {
const hasRef = !refPropertyName || !!bar[refPropertyName]; currentBar = bar;
if (hasRef) { if (onFocusedScreen)
currentBar = bar; break;
if (onFocusedScreen)
break;
}
} }
} }