Skip to content

Fix LaunchAndFocus: always close splash, return false on failure - #50

Open
goldorakiller wants to merge 1 commit into
RetroBat-Official:mainfrom
goldorakiller:fix/launch-and-focus-splash-and-return
Open

Fix LaunchAndFocus: always close splash, return false on failure#50
goldorakiller wants to merge 1 commit into
RetroBat-Official:mainfrom
goldorakiller:fix/launch-and-focus-splash-and-return

Conversation

@goldorakiller

Copy link
Copy Markdown
Contributor

Follow-up to review feedback on #48.

  • The black splash was only closed inside the success branch (esHandle != IntPtr.Zero && !isExternalLauncher). When the main window handle was never obtained - exclusive fullscreen, or EmulationStation exiting early - it stayed on screen for the whole wait. It is now closed unconditionally right after the (bounded) wait loop, with a finally block as a safety net if an exception is thrown earlier. CloseBlackSplash is idempotent, so the extra call is harmless.

  • The method returned true even when an exception was caught, so callers could not distinguish a successful launch from a failed one. The success return is now at the end of the try block and the catch returns false. The XML doc was updated to match the new contract.

Follow-up to review feedback on RetroBat-Official#48.

- The black splash was only closed inside the success branch
  (esHandle != IntPtr.Zero && !isExternalLauncher). When the main window
  handle was never obtained - exclusive fullscreen, or EmulationStation
  exiting early - it stayed on screen for the whole wait. It is now
  closed unconditionally right after the (bounded) wait loop, with a
  finally block as a safety net if an exception is thrown earlier.
  CloseBlackSplash is idempotent, so the extra call is harmless.

- The method returned true even when an exception was caught, so callers
  could not distinguish a successful launch from a failed one. The
  success return is now at the end of the try block and the catch
  returns false. The XML doc was updated to match the new contract.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant