summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorKarol Kosek <krkk@serenityos.org>2022-06-14 19:38:32 +0200
committerSam Atkins <atkinssj@gmail.com>2022-06-20 12:55:50 +0100
commit03cda8a01304396f17df459a7a6e2c360b57944a (patch)
treed0b1d9f40ca78c791c10d49c3c43d9ae74e90b15 /Userland/Libraries
parent0e045326238c0ecbb5d3a6dc06c454dd668b949f (diff)
downloadserenity-03cda8a01304396f17df459a7a6e2c360b57944a.zip
LibWeb+LibWebView+WebContent: Get doubleclick events from LibGUI
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/Page/Page.cpp5
-rw-r--r--Userland/Libraries/LibWeb/Page/Page.h1
-rw-r--r--Userland/Libraries/LibWebView/OutOfProcessWebView.cpp5
-rw-r--r--Userland/Libraries/LibWebView/OutOfProcessWebView.h1
4 files changed, 12 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Page/Page.cpp b/Userland/Libraries/LibWeb/Page/Page.cpp
index 98f748d40a..71c5acc05f 100644
--- a/Userland/Libraries/LibWeb/Page/Page.cpp
+++ b/Userland/Libraries/LibWeb/Page/Page.cpp
@@ -79,6 +79,11 @@ bool Page::handle_mousemove(Gfx::IntPoint const& position, unsigned buttons, uns
return top_level_browsing_context().event_handler().handle_mousemove(position, buttons, modifiers);
}
+bool Page::handle_doubleclick(Gfx::IntPoint const& position, unsigned button, unsigned modifiers)
+{
+ return top_level_browsing_context().event_handler().handle_doubleclick(position, button, modifiers);
+}
+
bool Page::handle_keydown(KeyCode key, unsigned modifiers, u32 code_point)
{
return focused_context().event_handler().handle_keydown(key, modifiers, code_point);
diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h
index cbf6b1e35b..d4880288e1 100644
--- a/Userland/Libraries/LibWeb/Page/Page.h
+++ b/Userland/Libraries/LibWeb/Page/Page.h
@@ -51,6 +51,7 @@ public:
bool handle_mousedown(Gfx::IntPoint const&, unsigned button, unsigned modifiers);
bool handle_mousemove(Gfx::IntPoint const&, unsigned buttons, unsigned modifiers);
bool handle_mousewheel(Gfx::IntPoint const&, unsigned button, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
+ bool handle_doubleclick(Gfx::IntPoint const&, unsigned buttons, unsigned modifiers);
bool handle_keydown(KeyCode, unsigned modifiers, u32 code_point);
bool handle_keyup(KeyCode, unsigned modifiers, u32 code_point);
diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp
index f5949ed857..1e248aed52 100644
--- a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp
+++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp
@@ -184,6 +184,11 @@ void OutOfProcessWebView::mousewheel_event(GUI::MouseEvent& event)
client().async_mouse_wheel(to_content_position(event.position()), event.button(), event.buttons(), event.modifiers(), event.wheel_delta_x(), event.wheel_delta_y());
}
+void OutOfProcessWebView::doubleclick_event(GUI::MouseEvent& event)
+{
+ client().async_doubleclick(to_content_position(event.position()), event.button(), event.buttons(), event.modifiers());
+}
+
void OutOfProcessWebView::theme_change_event(GUI::ThemeChangeEvent& event)
{
GUI::AbstractScrollableWidget::theme_change_event(event);
diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.h b/Userland/Libraries/LibWebView/OutOfProcessWebView.h
index 3a7cf3ab15..ee24156ff8 100644
--- a/Userland/Libraries/LibWebView/OutOfProcessWebView.h
+++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.h
@@ -123,6 +123,7 @@ private:
virtual void mouseup_event(GUI::MouseEvent&) override;
virtual void mousemove_event(GUI::MouseEvent&) override;
virtual void mousewheel_event(GUI::MouseEvent&) override;
+ virtual void doubleclick_event(GUI::MouseEvent&) override;
virtual void keydown_event(GUI::KeyEvent&) override;
virtual void keyup_event(GUI::KeyEvent&) override;
virtual void theme_change_event(GUI::ThemeChangeEvent&) override;