summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Page/EventHandler.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-14 11:33:20 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-14 12:15:11 +0200
commit6b4a7d1ee34627ec52047b7be1a1ba829e49c340 (patch)
treec4418264e2908f23b60d0d192fdcb2edebb9682c /Libraries/LibWeb/Page/EventHandler.cpp
parentd1d95458759bb3db08eadc5d33512a0157c9a298 (diff)
downloadserenity-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.cpp2
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())