1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:17:44 +00:00

Run: Trigger on escape key only once

When you press the escape key in the Browse dialog, the key down event
closes the dialog while the key up event then closes the Run window.

Prevent this by only listening to key down events.
This commit is contained in:
Jelle Raaijmakers 2022-08-02 13:07:19 +02:00 committed by Linus Groh
parent c72482da54
commit 379c7c2f64

View file

@ -71,7 +71,7 @@ RunWindow::RunWindow()
void RunWindow::event(Core::Event& event) void RunWindow::event(Core::Event& event)
{ {
if (event.type() == GUI::Event::KeyUp || event.type() == GUI::Event::KeyDown) { if (event.type() == GUI::Event::KeyDown) {
auto& key_event = static_cast<GUI::KeyEvent&>(event); auto& key_event = static_cast<GUI::KeyEvent&>(event);
if (key_event.key() == Key_Escape) { if (key_event.key() == Key_Escape) {
// Escape key pressed, close dialog // Escape key pressed, close dialog