From c9fb3e07d2e4ad786f4a746eea4a2fe7d540050e Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 9 Feb 2024 17:06:48 +0000 Subject: [PATCH] BrickGame: Make action shortcuts work when the game is paused We previously never called event.ignore(), so the keydown event for F2 or F11 etc would be consumed by the BrickGame widget instead of bubbling up. Now you can start a new game, or escape fullscreen mode, even if you've paused the game. :^) --- Userland/Games/BrickGame/BrickGame.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Games/BrickGame/BrickGame.cpp b/Userland/Games/BrickGame/BrickGame.cpp index c93c28faac..ba61cb1ac1 100644 --- a/Userland/Games/BrickGame/BrickGame.cpp +++ b/Userland/Games/BrickGame/BrickGame.cpp @@ -509,8 +509,10 @@ void BrickGame::keydown_event(GUI::KeyEvent& event) break; } - if (m_brick_game->state() == Bricks::GameState::Paused) + if (m_brick_game->state() == Bricks::GameState::Paused) { + event.ignore(); return; + } Bricks::RenderRequest render_request { Bricks::RenderRequest::SkipRender }; switch (event.key()) {