1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-13 01:02:18 -04:00

running apps: make settings bar-specific

This commit is contained in:
bbedward
2026-02-05 14:37:05 -05:00
parent 6b537f30a5
commit c2ee41c844
9 changed files with 448 additions and 72 deletions

View File

@@ -335,6 +335,33 @@ Singleton {
return toplevels;
}
function filterCurrentDisplay(toplevels, screenName) {
if (!toplevels || toplevels.length === 0 || !screenName)
return toplevels;
if (useNiriSorting)
return NiriService.filterCurrentDisplay(toplevels, screenName);
if (isHyprland)
return filterHyprlandCurrentDisplaySafe(toplevels, screenName);
return toplevels;
}
function filterHyprlandCurrentDisplaySafe(toplevels, screenName) {
if (!toplevels || toplevels.length === 0 || !Hyprland.toplevels)
return toplevels;
let monitorWindows = new Set();
try {
const hy = Array.from(Hyprland.toplevels.values);
for (const t of hy) {
const mon = _get(t, ["monitor", "name"], "");
if (mon === screenName && t.wayland)
monitorWindows.add(t.wayland);
}
} catch (e) {}
return toplevels.filter(w => monitorWindows.has(w));
}
function filterHyprlandCurrentWorkspaceSafe(toplevels, screenName) {
if (!toplevels || toplevels.length === 0 || !Hyprland.toplevels)
return toplevels;