Merge pull request #79293 from ItsNL/add-accept-dialog-close-on-unfocused
Check `FLAG_POPUP` to close an AcceptDialog when parent is focused
This commit is contained in:
commit
2a9aaae8a5
2 changed files with 1 additions and 2 deletions
|
@ -626,7 +626,6 @@
|
|||
</member>
|
||||
<member name="popup_window" type="bool" setter="set_flag" getter="get_flag" default="false">
|
||||
If [code]true[/code], the [Window] will be considered a popup. Popups are sub-windows that don't show as separate windows in system's window manager's window list and will send close request when anything is clicked outside of them (unless [member exclusive] is enabled).
|
||||
[b]Note:[/b] This property only works with native windows.
|
||||
</member>
|
||||
<member name="position" type="Vector2i" setter="set_position" getter="get_position" default="Vector2i(0, 0)">
|
||||
The window's position in pixels.
|
||||
|
|
|
@ -45,7 +45,7 @@ void AcceptDialog::_input_from_window(const Ref<InputEvent> &p_event) {
|
|||
}
|
||||
|
||||
void AcceptDialog::_parent_focused() {
|
||||
if (close_on_escape && !is_exclusive()) {
|
||||
if (!is_exclusive() && get_flag(FLAG_POPUP)) {
|
||||
_cancel_pressed();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue