1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:47:35 +00:00

LibGUI: Improve automatic focus guessing somewhat

When opening a new window, we'll now try to find a suitable widget for
initial focus by picking the first available mouse-focusable one.

Whenever you press the tab key in a window with no focused widget,
we'll attempt to find a keyboard-focusable widget and give it focus.

This should make all applications keyboard-interactive immediately
without having to manually place focus with the mouse.
This commit is contained in:
Andreas Kling 2020-10-30 16:57:51 +01:00
parent 28df2ede06
commit ddad7575a9
2 changed files with 16 additions and 3 deletions

View file

@ -204,6 +204,7 @@ private:
virtual bool is_window() const override final { return true; }
void update_cursor();
void focus_a_widget_if_possible(FocusSource);
void handle_drop_event(DropEvent&);
void handle_mouse_event(MouseEvent&);