diff --git a/surfaces/quickshell/modules/ii/dock/Dock.qml b/surfaces/quickshell/modules/ii/dock/Dock.qml index 62df539..71f2cbf 100644 --- a/surfaces/quickshell/modules/ii/dock/Dock.qml +++ b/surfaces/quickshell/modules/ii/dock/Dock.qml @@ -54,22 +54,22 @@ Scope { // Scope property bool previewShowing: false // App mode: any fullscreen window on the focused monitor owns the - // display, so the dock hides. ii's own screenCorners/Background use this - // same scan (activeToplevel.wayland.fullscreen is NOT reliable); mirror - // it verbatim. - readonly property var focusedWorkspaces: Hyprland.workspaces.values.filter( - ws => ws.monitor && ws.monitor.name === Hyprland.focusedMonitor?.name) - readonly property var activeFullscreenWorkspace: root.focusedWorkspaces.filter( - ws => ws.active && ws.toplevels.values.filter(w => w.wayland?.fullscreen)[0] !== undefined)[0] - // The workspace scan above walks ext-foreign-toplevel-list, which never - // sees standalone `qs -p` windows (souveraine-settings): Hyprland has them - // fullscreen but the workspace reports zero toplevels. HyprlandData polls - // `hyprctl activewindow -j` — Hyprland's own IPC, the source of truth — so - // fall back to it. `fullscreen === 2` is Hyprland's real (not maximized) - // fullscreen mode. Primary check stays first: no IPC round-trip when it - // already answers. - readonly property bool activeMonitorHasFullscreen: root.activeFullscreenWorkspace !== undefined - || HyprlandData.activeWindow?.fullscreen === 2 + // display, so the dock hides. Two previous checks both had blind spots: + // (1) ws.toplevels scan via ext-foreign-toplevel-list used + // wayland?.fullscreen which is unreliable, and never saw + // standalone qs -p windows (souveraine-settings). + // (2) HyprlandData.activeWindow?.fullscreen === 2 only saw the + // focused window — missed fullscreen apps that lost focus to a + // layer-shell surface (the dock itself, notifications, OSK). + // HyprlandData.windowList (hyprctl clients -j) has ALL windows with + // their real fullscreen mode. Scan it for any fullscreen === 2 window + // on the focused monitor. Reactive: HyprlandData updates on every + // Hyprland event. + readonly property bool activeMonitorHasFullscreen: { + const focusedId = HyprlandData.monitors.find(m => m.focused)?.id; + if (focusedId === undefined) return false; + return HyprlandData.windowList.some(w => w.fullscreen === 2 && w.monitor === focusedId); + } function computeDockState() { if (root.activeMonitorHasFullscreen)