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:
parent
132d8134f2
commit
9ccefd6c73
1 changed files with 16 additions and 16 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue