summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Page/EventHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/Page/EventHandler.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Page/EventHandler.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp
index 90eed4faca..24166b3fb0 100644
--- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp
+++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp
@@ -191,12 +191,12 @@ bool EventHandler::handle_mouseup(Gfx::IntPoint const& position, unsigned button
return false;
}
auto offset = compute_mouse_event_offset(position, paintable->layout_node());
- node->dispatch_event(UIEvents::MouseEvent::create(UIEvents::EventNames::mouseup, offset.x(), offset.y(), position.x(), position.y()));
+ node->dispatch_event(UIEvents::MouseEvent::create_from_platform_event(UIEvents::EventNames::mouseup, offset.x(), offset.y(), position.x(), position.y(), button));
handled_event = true;
bool run_activation_behavior = true;
if (node.ptr() == m_mousedown_target && button == GUI::MouseButton::Primary) {
- run_activation_behavior = node->dispatch_event(UIEvents::MouseEvent::create(UIEvents::EventNames::click, offset.x(), offset.y(), position.x(), position.y()));
+ run_activation_behavior = node->dispatch_event(UIEvents::MouseEvent::create_from_platform_event(UIEvents::EventNames::click, offset.x(), offset.y(), position.x(), position.y(), button));
}
if (run_activation_behavior) {
@@ -308,7 +308,7 @@ bool EventHandler::handle_mousedown(Gfx::IntPoint const& position, unsigned butt
m_mousedown_target = node;
auto offset = compute_mouse_event_offset(position, paintable->layout_node());
- node->dispatch_event(UIEvents::MouseEvent::create(UIEvents::EventNames::mousedown, offset.x(), offset.y(), position.x(), position.y()));
+ node->dispatch_event(UIEvents::MouseEvent::create_from_platform_event(UIEvents::EventNames::mousedown, offset.x(), offset.y(), position.x(), position.y(), button));
}
// NOTE: Dispatching an event may have disturbed the world.
@@ -416,7 +416,7 @@ bool EventHandler::handle_mousemove(Gfx::IntPoint const& position, unsigned butt
}
auto offset = compute_mouse_event_offset(position, paintable->layout_node());
- node->dispatch_event(UIEvents::MouseEvent::create(UIEvents::EventNames::mousemove, offset.x(), offset.y(), position.x(), position.y()));
+ node->dispatch_event(UIEvents::MouseEvent::create_from_platform_event(UIEvents::EventNames::mousemove, offset.x(), offset.y(), position.x(), position.y()));
// NOTE: Dispatching an event may have disturbed the world.
if (!paint_root() || paint_root() != node->document().paint_box())
return true;