godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.99k stars 21.16k forks source link

Hang trying to close game window when debugging code #80798

Open balloonpopper opened 1 year ago

balloonpopper commented 1 year ago

Godot version

4.2.dev3

System information

Windows 10

Issue description

Run your game with a breakpoint in it When Godot reaches the breakpoint, the game window stays active instead of swapping to the debugger If you try to close the game window (using the "X" in the top right corner of the window) the process hangs and needs to be forcefully terminated. This does not happen if you hit "stop" in the debugger

Steps to reproduce

As above

Minimal reproduction project

N/A

Sauermann commented 1 year ago

Using the "X" in the top right corner of the window has the effect, that an event is sent to the process, but since the process is paused at a breakpoint, nothing happens. So my guess would be that this is intended behavior.

balloonpopper commented 1 year ago

If it's the intended behavior, then I'd suggest it's wrong. By clicking the button you're informing the operating system you want to close the window - that's the expected behavior in any Windows application. The close window button should force close the window - regardless of the state of the debugger, or failing that, switch focus to the debugger and open a popup with some sort of "please close debugger before closing the application" warning so people know why they can't close the window directly.

I can't think of any Windows application where clicking the close window button doesn't close the window unless it opens a "do you want to save your work first?" window.

jsjtxietian commented 1 year ago

I note that one just can't close the window using the "X" in the top right corner, no matter it hits the breakpoint or not.

To fix this I guess we need a way to communicate the button pressed info back to the godot editor and tell the editor to close the debugger or something like this. Using the "X" should have the same effect as closing the debugger.

KingSupernova31 commented 2 months ago

Note that this also happens if the game runs into an error, even with no breakpoint set. The minimize and fullscreen buttons still work, at least on MacOS, which feels inconsistent.