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 NOTIFICATION_WM_CLOSE_REQUEST in Embedded Floating Window #101895

Conversation

Hilderin
Copy link
Contributor

This PR should fixes the notification NOTIFICATION_WM_CLOSE_REQUEST when closing the floating window.

I changed the way the embedded process is closed. In the previous implementation, I based the code on the stop button in the editor which kills the process. Now, I use a native send message in Windows and Linux the close the game window.

I added to rework the WindowWrapper to prevent to closing of the floating window while the game is closing. That's why I added the WindowWrapper::set_override_close_request method.

I did not changed the editor stop button, it's working as before. It kills the process, preventing the notification.

Tested on Windows 11 and Ubuntu 23.10.

@Hilderin Hilderin force-pushed the fix-close-request-notification-embedded-game branch from 95dd9b0 to 9eed43d Compare January 22, 2025 02:03
@bruvzg bruvzg self-requested a review January 22, 2025 05:54
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.

Seems to be working as expected.

Note: if the process is taking a long time to process this notification, it will cause editor to fully lock-up until it's done or killed externally, but this seems to be an issue with embedded mode in general,

@Hilderin
Copy link
Contributor Author

Hilderin commented Jan 22, 2025

Oh, good point. I think this could be avoided if I pass a timeout in the SendMessage on Window. I'll try later.

EDITED: Nevermind, I already use a PostMessage which does not wait. The problem is probably that the procress is locked and cannot process windows message. Indeed it's actually a global issue.

@Repiteo Repiteo merged commit 76f074b into godotengine:master Jan 22, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jan 22, 2025

Thanks!

@akien-mga akien-mga changed the title Fix NOTIFICATION_WM_CLOSE_REQUEST in Embedded Floating Window Fix NOTIFICATION_WM_CLOSE_REQUEST in Embedded Floating Window Feb 10, 2025
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.

Closing game running in editor no longer sends NotificationWMCloseRequest - v4.4Beta1
3 participants