LibGUI: Only react on KeyDown when escaping a Dialog

Both KeyEvents aren't necessary and erroneously close two
Dialogs at once.
This commit is contained in:
thankyouverycool 2022-09-07 08:04:17 -04:00 committed by Linus Groh
parent 463aff827e
commit 51006930da
Notes: sideshowbarker 2024-07-17 07:20:16 +09:00

View File

@ -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<KeyEvent&>(event);
if (key_event.key() == KeyCode::Key_Escape) {
done(ExecResult::Cancel);