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 Floating Window request close when a dialog is opened #102470

Conversation

Hilderin
Copy link
Contributor

@Hilderin Hilderin commented Feb 6, 2025

This PR fixes the issue where the game window does not close when it receives a close request. Normally, when a dialog is open, Godot does not close when the user clicks the X button. However, when using the Floating Window, this behavior was not handled correctly. I expected Godot to always close when it received a close request. To address this, I disconnected the embedded process from the editor, allowing the Floating Window to move without repositioning the embedded process.

I added a new DisplayServer::request_close_embedded_process method that only sends the close request to the embedded process. This new method is now used when the user attempts to close the Floating Window. As a result, when a dialog is open, the Floating Window will not close, which is the expected behavior when it's not embedded.

godot.windows.editor.dev.x86_64_3Yvv0V5B10.mp4

@Hilderin Hilderin force-pushed the fix-floating-window-close-opened-dialog branch from 35b72ca to a3d0371 Compare February 6, 2025 01:34
@AThousandShips AThousandShips added this to the 4.4 milestone Feb 6, 2025
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Windows and Linux/XWayland, seems to be working as expected.

akien-mga added a commit to akien-mga/godot that referenced this pull request Feb 7, 2025
…ow-close-opened-dialog

Fix Floating Window request close when a dialog is opened
@akien-mga akien-mga merged commit 00d806a into godotengine:master Feb 7, 2025
20 checks passed
@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.

Game window not closing correctly if you have a dialog open
4 participants