From f25f2ba047aed2356a15ae1366460509d7120d1a Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Thu, 28 Sep 2023 00:36:27 +0100 Subject: [PATCH] GameOfLife: Focus on the game board when not editing settings This makes single key shortcuts work again :^) --- Userland/Games/GameOfLife/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Games/GameOfLife/main.cpp b/Userland/Games/GameOfLife/main.cpp index 1b2ea8e37d..fab07031db 100644 --- a/Userland/Games/GameOfLife/main.cpp +++ b/Userland/Games/GameOfLife/main.cpp @@ -63,6 +63,8 @@ ErrorOr serenity_main(Main::Arguments arguments) auto& board_widget_container = *main_widget->find_descendant_of_type_named("board_widget_container"); board_widget_container.set_layout(GUI::Margins {}, 0); auto& board_widget = board_widget_container.add(board_rows, board_columns); + board_widget.set_focus_policy(GUI::FocusPolicy::StrongFocus); + board_widget.set_focus(true); board_widget.randomize_cells(); board_widget.set_min_size(board_columns, board_rows);