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

Fix game window stops responding when debugger pauses #94452

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

jamie-pate
Copy link
Contributor

Fixes #73374
Redo of #94186

As of godot 4 On windows/osx the game window will be frozen and will not be updated.

In the debugger loop it calls

OS::get_singleton()->process_and_drop_events();
which allows windows/osx to handle system events. If the window doesn't handle these events then both systems will judge the window to be 'not responding' (osx beachball cursor)

When the event processing code was migrated from OS to DisplayServer the process_and_drop_events() logic was moved to DisplayServer, but the call inside the remote debugger pause loop was not updated to call the DisplayServer version, there are currently no implementations of OS::process_and_drop_events() so i removed it and switched to the new DisplayServer::force_process_and_drop_events() method.

Fixes godotengine#73374

As of godot 4 On windows/osx the game window will be frozen and will not
be updated.

In the debugger loop it calls

OS::get_singleton()->process_and_drop_events();
which allows windows/osx to handle system events. If the window doesn't
handle these events then both systems will judge the window to be 'not
responding' (osx beachball cursor)

When the event processing code was migrated from OS to DisplayServer the
process_and_drop_events() logic was moved to DisplayServer, but the call
inside the remote debugger pause loop was not updated to call the
DisplayServer version, there are currently no implementations of
OS::process_and_drop_events() so i removed it and switched to the new
DisplayServer::force_process_and_drop_events() method.
@jamie-pate jamie-pate requested review from a team as code owners July 16, 2024 20:47
@Calinou Calinou added this to the 4.3 milestone Jul 17, 2024
@akien-mga akien-mga requested a review from bruvzg July 17, 2024 12:31
@akien-mga
Copy link
Member

This looks correct to me.

Including servers/ stuff in core/ goes a bit against #53295, so it's not great, but it's not the first occurrence, we already have one for RenderingServer:

$ rg "include .servers"
io/resource_loader.cpp
43:#include "servers/rendering_server.h"

Preserving the encapsulation would require actually making it an OS method and implementing it in each OS platform, but that seems overkill.

@akien-mga akien-mga changed the title Fix Game window stops responding when debugger pauses Fix game window stops responding when debugger pauses Jul 17, 2024
@akien-mga akien-mga merged commit 0918fd2 into godotengine:master Jul 17, 2024
54 checks passed
@akien-mga
Copy link
Member

Thanks! Great find 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release crash topic:editor topic:gui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Game window is frozen during debugging when a code error occurs
3 participants