Repository navigation
Conversation
Assisted-by: OpenAI Codex Co-Authored-By: OpenAI Codex <codex@openai.com>
…t-menu # Conflicts: # gpu/vk/vk_menu.cpp # host/posix/display_sdl.c
|
Ah I was also going to add this. Can we also add a 'Restart' option? |
hckrman101
left a comment
There was a problem hiding this comment.
Nice, this is a clean reuse of the existing close path. It posts WM_CLOSE to the window, which goes through rx_close_asked() and hos_window_closed_exit() just like the X button (and like Restart now, minus the relaunch). That also works on Windows with no extra change, since display.c already handles WM_CLOSE. The new Row line fits main's Row layout, the confirm state is cleared on B/Esc, on moving off the row, switching tab and closing the menu, and nothing touches the ini or presets. CI is green and it merges cleanly.
Two small nits, nothing blocking:
- Restart now calls save() and pipeline_cache_save(true) before it posts its message. Quit goes straight to WM_CLOSE. If the normal window close already covers that, fine, but it is worth a quick look.
- kQuitRow = kCheatsRow - 1 relies on Quit staying right before Cheats in the table. A comment or a static_assert on the row name would keep a later reorder from silently moving it.
| if (press[7] && quit_selected) { | ||
| if (mine && !press[5]) { | ||
| if (quit_pending) { | ||
| if (const HWND window = app_window()) PostMessageA(window, WM_CLOSE, 0, 0); |
There was a problem hiding this comment.
Restart now does save() + pipeline_cache_save(true) before posting its message. Does the plain WM_CLOSE path already cover that, or should Quit do the same here?
There was a problem hiding this comment.
Good catch, it doesn't. The plain close only runs rx_close_asked(), which stops a shader preparation still under way, and then hos_window_closed_exit() exits. Nothing forces the pipeline cache, so it is only written by the every-300-presents save in vk_replay.cpp. Settings were already safe, since set_row saves each change.
a7b27de makes Quit call save() and pipeline_cache_save(true) before WM_CLOSE, the same as Restart now. On CachyOS, mkw_vk_pipelines.bin was rewritten in the same second as the Quit exit.
Review of NotRexed#1255: the window's own close (rx_close_asked, then hos_window_closed_exit) does not force the pipeline cache, so Quit now calls save() and pipeline_cache_save(true) before posting WM_CLOSE, as the restart question's Restart now does. A comment by the table says Quit and Cheats stay its last two rows, since kQuitRow and kCheatsRow count back from its end (rows[] is not constexpr, so a static_assert on the name cannot check it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review! Both points are in a7b27de:
Re-tested on CachyOS (RTX 5060, Hyprland) with a virtual Xbox Series controller, on a build of main a1c4bcd plus this branch. The menu tests pass ( About the Restart option you asked for: I'll send it as a separate PR, since CONTRIBUTING asks for one topic per pull request. It will reuse the same confirm step and the restart question's Restart now path ( |
|
The Restart option is now #1266. It is built on this branch, and only its last commit is new. |
hckrman101
left a comment
There was a problem hiding this comment.
Thanks, both covered: Quit now saves the settings and forces the pipeline cache before closing, like Restart now, and the comment by the table pins the row order. LGTM.
Add a Quit row to the Insert menu's Gameplay tab. The first activation shows Confirm. A second activation closes the game through the normal window-close path. B or Esc cancels the confirmation. The same action is available with Enter and mouse clicks.
This addresses the in-menu exit requested in #1203 and tracked in #1007.
Validation
Assisted by OpenAI Codex.