summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2022-11-17 09:17:30 -0500
committerAndreas Kling <kling@serenityos.org>2022-11-19 16:04:42 +0100
commit5c923977b71fd12ef0c0b40a96734f4f423f601d (patch)
treeb4545c07062de7b1baf19bfcf8a73d759271b293 /Userland/Libraries/LibGUI
parent2028fbeae33118cdff6c554dfb2f098150209ff4 (diff)
downloadserenity-5c923977b71fd12ef0c0b40a96734f4f423f601d.zip
LibGUI: Always close() Dialogs no matter the execution result
Fixes Blocking modal race conditions when new windows are created in the same scope as Dialogs.
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r--Userland/Libraries/LibGUI/Dialog.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/Dialog.cpp b/Userland/Libraries/LibGUI/Dialog.cpp
index 199ea47326..90147459a7 100644
--- a/Userland/Libraries/LibGUI/Dialog.cpp
+++ b/Userland/Libraries/LibGUI/Dialog.cpp
@@ -112,6 +112,8 @@ Dialog::ExecResult Dialog::exec()
void Dialog::done(ExecResult result)
{
+ Window::close();
+
if (!m_event_loop)
return;
m_result = result;
@@ -137,7 +139,6 @@ void Dialog::event(Core::Event& event)
void Dialog::close()
{
- Window::close();
done(ExecResult::Cancel);
}