godot
godot copied to clipboard
[3.x] Modeless WindowDialogs do not emit popup_hide
Godot version
3.5 stable
System information
Windows 10
Issue description
Setting a WindowDialog as exclusive will normally force the control as modal and capture all input outside its bounds until it's manually destroyed or hidden. However, by calling show() (and presumably manually setting the control to visible), one can create a persistent modeless window. These windows can be hidden by the close button, but this will not trigger the popup_hide signal and thus, cleanup operations can't be done without manually connecting the close button.
Steps to reproduce
- Add a WindowDialog to project. Set
exclusiveto true. - In the Node tab, add a signal connection for
popup_hide()to your parent script. Have itprint()data to show when it's triggered. - In the parent script, call
$WindowDialog.show()on ready -- calling apopup()derivative would force the control modal; we only want modeless operation without the auto-hide functionality - Run project and try to close the window from the close button.
Workaround:
add this line to the _ready() func of your WindowDialog:
get_close_button().connect("pressed", self, "[NAME OF FUNCTION HERE]")
Minimal reproduction project
No response