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
This commit is contained in:
Norman Feske 2023-05-03 17:17:43 +02:00 committed by Checker
parent 0e3a9bfe1f
commit f712d97763

View File

@ -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(); }
};
/**