diff --git a/modules/home/hyprland.nix b/modules/home/hyprland.nix index 4ec0146..6a14fee 100644 --- a/modules/home/hyprland.nix +++ b/modules/home/hyprland.nix @@ -656,6 +656,19 @@ ${lib.concatStringsSep "\n" (lib.mapAttrsToList # A new external supersedes any undock still queued for an older # departure: the panel is about to be disabled again on purpose. undock_pending= + # …and it supersedes a *completed* one too. Bernardo 2026-07-16: + # undocked, panel stayed dark; re-docked and undocked again and it + # came back — because in between he opened the lid. `awaiting_lid_open` + # is set by every successful undock and cleared only when the external + # is gone AND the lid is open, so a clamshell undock latches it; the + # next departure then hits the `[ -z "$awaiting_lid_open" ]` guard + # below, queues nothing, and the panel never returns. His journal shows + # exactly that: no `outputs-changed removed` for the first undock at + # all, then a release the moment he lifted the lid, then a clean + # undock. The latch means "this departure is dealt with" — a new + # external ends that departure, so clear it here or it outlives the + # thing it describes. + awaiting_lid_open= [ -z "$internal" ] || acquire_inhibitor # An external output that was not there a moment ago is an # unambiguous physical plug whether or not we saw the IPC event,