godot icon indicating copy to clipboard operation
godot copied to clipboard

[3.x] Modeless WindowDialogs do not emit popup_hide

Open nobuyukinyuu opened this issue 3 years ago • 0 comments

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

  1. Add a WindowDialog to project. Set exclusive to true.
  2. In the Node tab, add a signal connection for popup_hide() to your parent script. Have it print() data to show when it's triggered.
  3. In the parent script, call $WindowDialog.show() on ready -- calling a popup() derivative would force the control modal; we only want modeless operation without the auto-hide functionality
  4. 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

nobuyukinyuu avatar Sep 24 '22 00:09 nobuyukinyuu