Repository navigation
fix(g6): a window created hidden stops rendering once its page loads - #991
Merged
Merged
Conversation
A window created hidden (the pre-warmed toast and brief windows, the main window before first light) gets no WM_SHOWWINDOW / WM_SIZE until it is first shown, so its WebView2 controller kept wry's creation-time IsVisible = true: the never-shown brief window read visibilityState "visible" with requestAnimationFrame at ~240 fps (operator app, 2026-10-18). On Tauri's page-load Finished event the plugin now applies the host window's real state (visible && !minimised) through the same per-window tracker; nothing is set before the page has loaded. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018hjX3pEMmC7CHfG41PiPj7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #967 (G6 idle). A window created hidden never receives
WM_SHOWWINDOWorWM_SIZEuntil it is first shown. Sowebview_visibility(which left the initial state alone and only followed messages) never touched its WebView2 controller, which kept wry's creation-timeIsVisible = true.Found live on the operator app (main 4d257b9): the never-shown brief window read
visibilityState "visible", withrequestAnimationFrameat ~240 fps (595–601 frames in 2.5 s), while hidden.Fix
webview_visibilitynow also listens for Tauri's page-load event:IsVisible = IsWindowVisible && !IsIconic.GetWindowSubclass), so the message-driven transitions stay in step.a_page_that_loads_in_a_hidden_window_stops_rendering. It covers loading in a hidden window, in a minimised window, and in a visible window (a reload of the shown main window).Live check
Isolated debug instance: identifier
com.4da.app.g6rel, ports 4448/4449,FOURDA_DATA_DIRon a read-onlyVACUUM INTOcopy of the live DB, LLM providernone.visibilityState "hidden", 0 rAF frames in 2.5 s;hidden, 0;visible, 357.visiblewith 600 rAF while on screen. The card was dark on screen within ~45 ms of the command returning.visiblewith 601 rAF. After its close button: native hidden,hidden, 0 rAF.Side finding (not the same mechanism; not fixed here)
In two release runs, the toast window's script never reported ready at startup. The app then destroyed and recreated the window, and the first toast did not show. This is not the
IsVisibleproblem; it looks like a lostnotification-readyevent.app_setup.rsthe toast window is created (line 1688) before thenotification-readylistener is registered (line 1698).notification-readybefore anyone listens.app_setup.rs, which another lane owns: register thenotification-readyandbriefing-readylisteners before creating the windows.Checks
cargo fmtclean;webview_visibilitytests pass; the pre-push hooks pass.🤖 Generated with Claude Code
https://claude.ai/code/session_018hjX3pEMmC7CHfG41PiPj7