[MacOS] Fix so that the main window is displayed before the splash screen minimum display time starts counting #72307
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.
This fixes issue #68798 where the "Minimum Display Time" setting doesn't work on MacOS. In my testing on MacOS the window isn't displayed until the
DisplayServer->process_events()
method is called. This doesn't happen until the main loop has begun and that occurs after the "Minimum Display Time" has passed. Presumably the act of creating a window is itself an event that has to be processed?The fix I found was to call the
DisplayServer->force_process_and_drop_events()
method after theshow_window()
method is called for the main window. It's also possible to fix by callingDisplayServer->process_events()
, but since we aren't processing input yet it seems thatforce_process_and_drop_events
is suitable since it ignores input events. Perhaps someone who has more experience with the codebase knows ifprocess_events()
would be better or if I should place the call elsewhere?With this change the window is displayed with the background color for the amount of time specified and then the logo is shown for a split second before the game is shown. This makes the behaviour the same as on Windows, the logo not being displayed until the end of the display time is reported in issue #71350 and likely not related to this since it isn't MacOS specific.
Bugsquad edit: