From f712d977638158af2d2560fd5507147e9a564db6 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 3 May 2023 17:17:43 +0200 Subject: [PATCH] sculpt: always update keyboard focus after input This patch solves keyboard-focus issues with the wifi dialog that were caused by making the focus update conditional. However, since the update is not expensive, we can unconditionally re-evaluate the focus atfer each user interaction. Issue #4820 Fixes #4856 --- repos/gems/src/app/sculpt_manager/main.cc | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/repos/gems/src/app/sculpt_manager/main.cc b/repos/gems/src/app/sculpt_manager/main.cc index e1410c446c..4073811bc5 100644 --- a/repos/gems/src/app/sculpt_manager/main.cc +++ b/repos/gems/src/app/sculpt_manager/main.cc @@ -785,25 +785,13 @@ struct Sculpt::Main : Input_event_handler, } } - bool _keyboard_input_consumed_by_sculpt_manager() const - { - return (_keyboard_focus.target == Keyboard_focus::WPA_PASSPHRASE) - || (_system_visible && _system_dialog.keyboard_needed()); - } - struct Keyboard_focus_guard { Main &_main; - bool const _orig = _main._keyboard_input_consumed_by_sculpt_manager(); - Keyboard_focus_guard(Main &main) : _main(main) { } - ~Keyboard_focus_guard() - { - if (_orig != _main._keyboard_input_consumed_by_sculpt_manager()) - _main._keyboard_focus.update(); - } + ~Keyboard_focus_guard() { _main._keyboard_focus.update(); } }; /**