1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-11 16:22:09 -04:00

dock: fix intelligent auto hide on hyprland

fixes #1535
This commit is contained in:
bbedward
2026-02-10 17:28:39 -05:00
parent b04cb7b3cc
commit 081b15e24c
2 changed files with 22 additions and 16 deletions

View File

@@ -368,18 +368,26 @@ Singleton {
let currentWorkspaceId = null;
try {
const hy = Array.from(Hyprland.toplevels.values);
for (const t of hy) {
const mon = _get(t, ["monitor", "name"], "");
const wsId = _get(t, ["workspace", "id"], null);
const active = !!_get(t, ["activated"], false);
if (mon === screenName && wsId !== null) {
if (active) {
currentWorkspaceId = wsId;
break;
if (Hyprland.monitors) {
const monitor = Hyprland.monitors.values.find(m => m.name === screenName);
if (monitor)
currentWorkspaceId = _get(monitor, ["activeWorkspace", "id"], null);
}
if (currentWorkspaceId === null) {
const hy = Array.from(Hyprland.toplevels.values);
for (const t of hy) {
const mon = _get(t, ["monitor", "name"], "");
const wsId = _get(t, ["workspace", "id"], null);
const active = !!_get(t, ["activated"], false);
if (mon === screenName && wsId !== null) {
if (active) {
currentWorkspaceId = wsId;
break;
}
if (currentWorkspaceId === null)
currentWorkspaceId = wsId;
}
if (currentWorkspaceId === null)
currentWorkspaceId = wsId;
}
}
@@ -387,7 +395,7 @@ Singleton {
const wss = Array.from(Hyprland.workspaces.values);
const focusedId = _get(Hyprland, ["focusedWorkspace", "id"], null);
for (const ws of wss) {
const monName = _get(ws, ["monitor"], "");
const monName = _get(ws, ["monitor", "name"], "");
const wsId = _get(ws, ["id"], null);
if (monName === screenName && wsId !== null) {
if (focusedId !== null && wsId === focusedId) {
@@ -406,7 +414,6 @@ Singleton {
if (currentWorkspaceId === null)
return toplevels;
// Map wayland → wsId snapshot
let map = new Map();
try {
const hy = Array.from(Hyprland.toplevels.values);