Watch
1
0
Fork
You've already forked souveraine
0

dock: fix fullscreen detection — scan all windows, not just active/focused

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 <noreply@anthropic.com>
This commit is contained in:
Fimeg 2026-07-22 21:25:08 -04:00
commit 9ccefd6c73

View file

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