mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-16 13:59:56 -04:00
The review of the window close change found that hiding the active window in gfx_window_win.c exit_start makes Windows send WM_ACTIVATEAPP(FALSE), which wnd_proc passed on to gfx_window_focus_changed(0). In play, perf.c perf_focus_lost then asked for the session's reports, and the present thread, which runs until rt_exit_steps reaches prof_write, wrote "frametime: at focus loss" for the whole session at its next present, with the stutter map and the memory ranking, and started a new period. "frametime: exit" then covered only the few frames since the hide, or was missing when none came, so a normal close no longer left the exit summary the play-test's "Normal close" item reads. wnd_proc now returns at a focus loss once g_exit_started is set. exit_start sets it on the window thread before ShowWindow, and the message comes on the same thread inside that call, so the check has no race. A gained focus is still passed on. Not reproduced before the change (it needs a play run). tests/exit_order_check.py checks statically that WM_ACTIVATEAPP returns before gfx_window_focus_changed for a loss once g_exit_started is set and that exit_start sets the flag before the hide; the check fails on the code before this change and passes after it. The compile check of gfx_window_win.c passes with no new -Wall warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 KiB
41 KiB