diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-14 11:33:20 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-14 12:15:11 +0200 |
commit | 6b4a7d1ee34627ec52047b7be1a1ba829e49c340 (patch) | |
tree | c4418264e2908f23b60d0d192fdcb2edebb9682c /Libraries/LibWeb/Page/EventHandler.cpp | |
parent | d1d95458759bb3db08eadc5d33512a0157c9a298 (diff) | |
download | serenity-6b4a7d1ee34627ec52047b7be1a1ba829e49c340.zip |
LibWeb: Add "focused frame" concept, one focused Frame per Page
Focus currently only moves when doing a mousedown in a frame.
Diffstat (limited to 'Libraries/LibWeb/Page/EventHandler.cpp')
-rw-r--r-- | Libraries/LibWeb/Page/EventHandler.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Page/EventHandler.cpp b/Libraries/LibWeb/Page/EventHandler.cpp index 55769c7699..748ff0f31a 100644 --- a/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Libraries/LibWeb/Page/EventHandler.cpp @@ -119,6 +119,8 @@ bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned butt return false; } + m_frame.page().set_focused_frame({}, m_frame); + auto offset = compute_mouse_event_offset(position, *result.layout_node); node->dispatch_event(UIEvents::MouseEvent::create("mousedown", offset.x(), offset.y())); if (!layout_root()) |