From a77d8b3eb58721355656d71c385a9a35f8160411 Mon Sep 17 00:00:00 2001 From: NL Date: Fri, 14 Jul 2023 19:09:13 +0200 Subject: [PATCH] Check FLAG_POPUP to close an AcceptDialog when parent is focused --- doc/classes/Window.xml | 1 - scene/gui/dialogs.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index 0446f6d73f6..450cf372835 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -626,7 +626,6 @@ 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. The window's position in pixels. diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 0860bf39682..4360c48a38f 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -45,7 +45,7 @@ void AcceptDialog::_input_from_window(const Ref &p_event) { } void AcceptDialog::_parent_focused() { - if (close_on_escape && !is_exclusive()) { + if (!is_exclusive() && get_flag(FLAG_POPUP)) { _cancel_pressed(); } }