From 43e0d825a7fb2b3e5bdd3d4c418bbd2e8b8e6a4a Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Wed, 21 Oct 2026 16:02:18 +0700 Subject: [PATCH] docs: record the fullscreen auto-hide status and decisions --- .../phase-08-fullscreen-auto-hide.md | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/plans/261021-1028-tauri-v2-port/phase-08-fullscreen-auto-hide.md b/plans/261021-1028-tauri-v2-port/phase-08-fullscreen-auto-hide.md index 52361e6..9b67e1d 100644 --- a/plans/261021-1028-tauri-v2-port/phase-08-fullscreen-auto-hide.md +++ b/plans/261021-1028-tauri-v2-port/phase-08-fullscreen-auto-hide.md @@ -1,7 +1,7 @@ --- phase: 8 title: "Fullscreen auto-hide" -status: pending +status: in-progress priority: P2 effort: "2h" dependencies: [6] @@ -49,9 +49,29 @@ that window's class is in the ignore list, it is cloaked, or it is minimized. 2. Add the x11rb reader. 3. Add unit tests for `core::visibility::next` covering every row of the Phase 06 table, including a user show during fullscreen and fullscreen off while user-hidden. +## Todo + +- [x] `platform::foreground_is_fullscreen()` dispatcher in `src/platform/mod.rs`; native Wayland (no X11 positioning) reports false +- [x] Windows: the v0.5.0 evaluation moved into `src/platform/windows.rs`, with the bubble-class check replaced by the own-PID check (`GetWindowThreadProcessId`); `Progman`, `WorkerW` and `Shell_TrayWnd` still ignored; `rect_covers_monitor` and the style bits come from `core::geom`, whose two tests stay there +- [x] Linux: x11rb reader on the shared cached connection (`_NET_ACTIVE_WINDOW`, `_NET_WM_STATE`, `_NET_WM_PID`), pure `evaluate_active_window` unit-tested +- [x] macOS stub returning false, pointing at `CGWindowListCopyWindowInfo` +- [x] `src/fullscreen.rs`: 1500 ms thread, snapshots the visibility state, then `Runtime::apply_visibility` outside the lock; each hide/show decision logged with reason and detail under `--diagnose` +- [x] `core::visibility::next` tests cover every row of the Phase 06 table (user show during fullscreen, fullscreen off while user-hidden); `fullscreen::` tests cover check sequences through it +- [x] Host: `cargo fmt --check`, `cargo clippy --all-targets -- -D warnings`, `cargo test` (197 passed, 1 ignored), `cargo test -- fullscreen:: visibility::` (9 passed), `npm run lint`, `npm test` (37 passed), `npm run tauri build -- --no-bundle`; CI green on `windows-latest`, `ubuntu-22.04` and `macos-latest` +- [ ] Linux desktop (X11) and Windows manual checks below + +## Implementation notes + +- `foreground_is_fullscreen()` returns a `FullscreenCheck { fullscreen, reason, detail }` instead of a `(bool, &'static str)` pair, so the diagnostic log keeps the window handle, class, bounds and monitor that v0.5.0 logged. +- Linux also treats a `_NET_WM_STATE_HIDDEN` (minimized) active window as not fullscreen, the X11 counterpart of the Windows minimized check. A window without `_NET_WM_PID` is not ours. A failed query (the window vanished between reads) counts as not fullscreen. +- Decisions are logged only when they change the bubbles, as v0.5.0 did; logging every 1.5 s tick would flood the log. +- A user show during fullscreen keeps `hidden_by_fullscreen`, so the next tick does not hide the bubbles again; leaving fullscreen then clears the flag. +- The thread starts before the bubbles are created; a bubble created while fullscreen is active stays hidden through `Visibility::shows`. +- The listed `cargo test fullscreen:: visibility::` is not valid cargo syntax (one filter before `--`); the equivalent is `cargo test -- fullscreen:: visibility::`. + ## Validation -- Host: `cargo test fullscreen:: visibility::` is green. +- Host: `cargo test -- fullscreen:: visibility::` is green. - Linux desktop (X11, manual): a fullscreen browser (F11) hides the bubbles within 1.5 s, and they come back when it exits. - Windows (CI artifact, manual): a fullscreen game or video hides them, a maximized window does not, the desktop does not, and opening the bubble menu or the panel does not.