HydraIssues

hydrabody isTaskbarHidden() returns true when taskbar is visually present; Tick() safety-net fails
open bug Project: hydrabody Reporter: 22 Apr 2026 17:42

Description

## Context

Follow-up to #43 (done — startup race). On 2026-04-22 I observed the Windows taskbar visible on boom-pickle-38 MID-STREAM-CYCLE (not at startup). At the same moment hydrabody reported `taskbar_hidden: true` on its kiosk status endpoint. Forcing a kiosk disable+enable cycle re-hid the taskbar. So:

- The taskbar had reappeared after a Sunshine stream transition.
- hydrabody's `Tick()` safety-net at `pkg/provider/kiosk_windows.go:169` is supposed to re-hide it:
```
if !k.isTaskbarHidden() {
k.hideTaskbar()
}
```
- But `isTaskbarHidden()` returned `true`, so the safety-net never fired. Meanwhile the taskbar was visually visible and would have been captured by the stream.

## Likely cause

`isTaskbarHidden()` probably checks a window-style bit (e.g., `WS_VISIBLE` on Shell_TrayWnd) rather than actual on-screen visibility. Sunshine or another process (display mode change, virtual display swap, experience launch) can push the taskbar back into view via API paths that don't flip the style bit our check watches.

## Proposal

Rework `isTaskbarHidden()` to be robust:

Option A (simplest): combine multiple signals — style bit + `IsWindowVisible(Shell_TrayWnd)` + `GetWindowRect` not off-screen + possibly `DwmGetWindowAttribute(DWMWA_CLOAKED)`. If any of them says "visible", consider it visible.

Option B: instead of conditionally re-hiding, always call `hideTaskbar()` each tick (idempotent). Slight extra work but deterministic.

Option B is probably fine since Win32 hide calls are cheap and the tick is already ~1 Hz.

## Impact

Every stream transition risks a visible taskbar flash in the stream output on bodies where this check fails (seen on boom-pickle; likely fleet-wide).

## References

- #43 "Windows taskbar visible on hydraheadwebstream startup" (done) — covered the startup race, didn't address the steady-state safety-net.
- Observed 2026-04-22 on boom-pickle-38 during rupelmonde-castle-viewer stream cycles.