-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Expose dialog parent-and-popup logic to the API #76025
Expose dialog parent-and-popup logic to the API #76025
Conversation
c5b0c37
to
0aac5e4
Compare
Since relevant parts were extracted with #76176, which is merged, this is now rebased on top of master and ready for review. |
0aac5e4
to
dfb2e28
Compare
@bruvzg I added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if popup_exclusive()
is accurate name, because dialogs are exclusive by default (otherwise we wouldn't be getting exclusive errors).
Other than that looks fine.
dfb2e28
to
17f492f
Compare
That's a good point. The idea behind the name is that it ensures that exclusivity is respected, but perhaps it's not clear. Don't have a better suggestion myself at the moment. I don't think it's a misnomer though. |
Thanks! |
This intends to be the correct way to handle non-child windows becoming covered by the current window when becoming focused. Enabling this property on select windows, they will become transient to the currently focused one when becoming visible. This deprecates the "unparent_when_invisible" function introduced by godotengine#76025.
This intends to be the correct way to handle non-child windows becoming covered by the current window when becoming focused. Enabling this property on select windows, they will become transient to the currently focused one when becoming visible. This deprecates the "unparent_when_invisible" function introduced by godotengine#76025.
This was introduced in a hacky way before to fix immediate issues with some of the editor windows (see #73365). But I think we should have this feature generally accessible, so we can address similar issues in other editor windows, and so plugin developers could use it too. In fact, this is probably useful to user projects as well, if they support multiple windows.
So this removes the old hacky class and moves the necessary functionality to other places.
EditorInterface
receives newpopup_dialog_*
methods to automatically reparent a window to the editor UI before popping it up.Window
receivesset_unparent_when_invisible
, a new scripting-only method to enable the "unparent this window when visibility changes to not visible" logic. It's scripting-only because using it requires you to have a script, and enabling it by accident can lead to orphan nodes.Window
also receives newpopup_exclusive_*
methods, which powerEditorInterface
methods secretly.Node
receivesget_last_exclusive_window
, which tries to find the top-most exclusive child of the owner window, or returns the parent window (or nothing, if there is no window); this can be exposed as a part ofWindow
as well, but being a part ofNode
makes it easier to use, as it can handle the owner window internally and return a clean result.Marking as a draft as this is based on the
EditorInterface
refactoring from #75694.