From 9ccefd6c73dfbb026a41090aac3b400c7b2e229c Mon Sep 17 00:00:00 2001 From: Fimeg Date: Wed, 22 Jul 2026 21:25:08 -0400 Subject: [PATCH] =?UTF-8?q?dock:=20fix=20fullscreen=20detection=20?= =?UTF-8?q?=E2=80=94=20scan=20all=20windows,=20not=20just=20active/focused?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous fullscreen detection had two blind spots: 1. Workspace scan used wayland?.fullscreen (unreliable) and missed qs -p windows 2. HyprlandData.activeWindow fallback only saw the focused window — missed fullscreen apps that lost focus to layer-shell surfaces (dock, notifications) Now scans HyprlandData.windowList (hyprctl clients -j) for any window with fullscreen === 2 on the focused monitor. Source of truth for all windows, not just the active one. Reactive via HyprlandData's event-driven updates. Co-Authored-By: Claude --- surfaces/quickshell/modules/ii/dock/Dock.qml | 32 ++++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) 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)