From 51006930da16118da814ca650084157fceb36417 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Wed, 7 Sep 2022 08:04:17 -0400 Subject: [PATCH] LibGUI: Only react on KeyDown when escaping a Dialog Both KeyEvents aren't necessary and erroneously close two Dialogs at once. --- Userland/Libraries/LibGUI/Dialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/Dialog.cpp b/Userland/Libraries/LibGUI/Dialog.cpp index f9281082fa7..e4c3a9ef565 100644 --- a/Userland/Libraries/LibGUI/Dialog.cpp +++ b/Userland/Libraries/LibGUI/Dialog.cpp @@ -121,7 +121,7 @@ void Dialog::done(ExecResult result) void Dialog::event(Core::Event& event) { - if (event.type() == Event::KeyUp || event.type() == Event::KeyDown) { + if (event.type() == Event::KeyDown) { auto& key_event = static_cast(event); if (key_event.key() == KeyCode::Key_Escape) { done(ExecResult::Cancel);