diff options
author | Karol Kosek <krkk@serenityos.org> | 2022-06-14 19:39:33 +0200 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-06-20 12:55:50 +0100 |
commit | 237a5bedd259e606027f36e2b758f4bafde9048b (patch) | |
tree | 361a312261e03032504d40d6d64ab0a6adb34ef3 /Userland/Libraries/LibWeb | |
parent | 03cda8a01304396f17df459a7a6e2c360b57944a (diff) | |
download | serenity-237a5bedd259e606027f36e2b758f4bafde9048b.zip |
LibWeb: Dispatch `dblclick` UI Events on double click
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/Page/EventHandler.cpp | 3 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/UIEvents/EventNames.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index 585cf6e748..ecdfdd9cf7 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -542,7 +542,8 @@ bool EventHandler::handle_doubleclick(Gfx::IntPoint const& position, unsigned bu if (!node || !layout_node) return false; - // FIXME: Dispatch 'dblclick' events. + auto offset = compute_mouse_event_offset(position, *layout_node); + node->dispatch_event(UIEvents::MouseEvent::create_from_platform_event(UIEvents::EventNames::dblclick, offset.x(), offset.y(), position.x(), position.y(), button)); // FIXME: Select word diff --git a/Userland/Libraries/LibWeb/UIEvents/EventNames.h b/Userland/Libraries/LibWeb/UIEvents/EventNames.h index 9c71ef4ab2..773543d0de 100644 --- a/Userland/Libraries/LibWeb/UIEvents/EventNames.h +++ b/Userland/Libraries/LibWeb/UIEvents/EventNames.h @@ -15,6 +15,7 @@ namespace Web::UIEvents::EventNames { #define ENUMERATE_UI_EVENTS \ __ENUMERATE_UI_EVENT(click) \ + __ENUMERATE_UI_EVENT(dblclick) \ __ENUMERATE_UI_EVENT(keydown) \ __ENUMERATE_UI_EVENT(keyup) \ __ENUMERATE_UI_EVENT(mousedown) \ |