Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BASE: Fix exiting scummvm_main loop in backend not allowing quit #5336

Merged
merged 1 commit into from Sep 20, 2023

Conversation

criezy
Copy link
Member

@criezy criezy commented Sep 18, 2023

On iOS, and possibly emscripten which is the only other backend using kFeatureNoQuit currently, closing the launcher dialog without starting a game results in a blank screen and the user has to force close and reopen ScummVM. This was reported in https://bugs.scummvm.org/ticket/14624 using the Esc key, or corresponding iOS gesture, while on the launcher.

The change in this pull request adds a loop to reopen the launcher if it was closed without starting a game and avoid existing scummvm_main(). I have tested that it indeed fixes the issue on the iOS simulator.

This is one of 4 possible solutions I considered. The other three are:

  • Use the same solution, but in LauncherChooser::runModal() instead of launcherDialog().
  • Ignore the Escape key in the LauncherDialog so that it does not close the dialog (unlike the other dialogs).
  • Do not allow closing the dialog in Dialog::close() / GuiManager::closeTopDialog() if this is the only dialog in the dialog stack and no game is being started or is running.

The third point is I think a no-go as it prevents switching between the list launcher and the grid launcher.

The second point could work I think (I didn't try it) and could also allow removing the possibility to Quit ScummVM using the Escape key while in the launcher for other backends. I don't know if this is something that we would like, but to me quitting the app using the Escape key seems a bit strange. However I am not sure if the Escape key is the only event that can trigger bug #14624 on iOS, or if there are other ways to close the launcher dialog.

The first point and the solution I implemented are a more global solution and should catch all the cases where the Launcher dialog is closed without starting a game. There is very little difference between the first point and the solution implemented, and it just seemed to be more logical to me to have the loop in launcherDialog().

Let me know if you see a way to improve it, if you see something I overlooked, or if you think I didn't select the best solution.

This could be triggered using the Escape key in the launcher.
This fixes bug #14624.
@sev-
Copy link
Member

sev- commented Sep 18, 2023

Sounds like a logical solution to me

@larsamannen
Copy link
Contributor

LGTM

1 similar comment
@bluegr
Copy link
Member

bluegr commented Sep 19, 2023

LGTM

@sev-
Copy link
Member

sev- commented Sep 20, 2023

Thanks. merging

@sev- sev- merged commit e66554b into scummvm:master Sep 20, 2023
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants