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

[MacOS] Fix so that the main window is displayed before the splash screen minimum display time starts counting #72307

Conversation

zoeesilcock
Copy link
Contributor

@zoeesilcock zoeesilcock commented Jan 29, 2023

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 the show_window() method is called for the main window. It's also possible to fix by calling DisplayServer->process_events(), but since we aren't processing input yet it seems that force_process_and_drop_events is suitable since it ignores input events. Perhaps someone who has more experience with the codebase knows if process_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:

@zoeesilcock zoeesilcock requested a review from a team as a code owner January 29, 2023 12:20
@zoeesilcock zoeesilcock force-pushed the fix/splash-minimum-display-time-macos branch from ab38395 to 673feee Compare January 29, 2023 12:25
@akien-mga akien-mga added this to the 4.0 milestone Jan 29, 2023
@zoeesilcock zoeesilcock force-pushed the fix/splash-minimum-display-time-macos branch from 673feee to 85ff7a2 Compare February 1, 2023 15:22
@akien-mga akien-mga merged commit 6daf4d6 into godotengine:master Feb 2, 2023
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Splash screen minimum display time does not work properly on macOS
3 participants