diff options
author | Dmitry Petrov <dpetroff@gmail.com> | 2021-12-13 23:22:28 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-20 10:37:52 +0100 |
commit | 166221373755503134716317a51762a5fbedf3a7 (patch) | |
tree | c7e5c2396144611c22dad9d749016b4151d1b0c3 /Userland | |
parent | d61cc47055e27b007005ac2355728ce54cbbb50b (diff) | |
download | serenity-166221373755503134716317a51762a5fbedf3a7.zip |
Userland: Add horizontal mouse scroll support
Diffstat (limited to 'Userland')
42 files changed, 111 insertions, 84 deletions
diff --git a/Userland/Applets/WorkspacePicker/DesktopStatusWindow.cpp b/Userland/Applets/WorkspacePicker/DesktopStatusWindow.cpp index 437fa7ff52..440e0f2157 100644 --- a/Userland/Applets/WorkspacePicker/DesktopStatusWindow.cpp +++ b/Userland/Applets/WorkspacePicker/DesktopStatusWindow.cpp @@ -76,7 +76,7 @@ public: auto vcols = desktop.workspace_columns(); auto vrows = desktop.workspace_rows(); - auto direction = event.wheel_delta() < 0 ? 1 : -1; + auto direction = event.wheel_delta_y() < 0 ? 1 : -1; if (event.modifiers() & Mod_Shift) col = abs((int)col + direction) % vcols; diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp index 996018dff1..6a660cc9a3 100644 --- a/Userland/Applications/3DFileViewer/main.cpp +++ b/Userland/Applications/3DFileViewer/main.cpp @@ -156,7 +156,7 @@ void GLContextWidget::mousemove_event(GUI::MouseEvent& event) void GLContextWidget::mousewheel_event(GUI::MouseEvent& event) { - if (event.wheel_delta() > 0) + if (event.wheel_delta_y() > 0) m_zoom /= 1.1f; else m_zoom *= 1.1f; diff --git a/Userland/Applications/PDFViewer/PDFViewer.cpp b/Userland/Applications/PDFViewer/PDFViewer.cpp index ccc79e544e..b8007a3369 100644 --- a/Userland/Applications/PDFViewer/PDFViewer.cpp +++ b/Userland/Applications/PDFViewer/PDFViewer.cpp @@ -75,7 +75,7 @@ void PDFViewer::mousewheel_event(GUI::MouseEvent& event) if (!m_document) return; - bool scrolled_down = event.wheel_delta() > 0; + bool scrolled_down = event.wheel_delta_y() > 0; if (event.ctrl()) { if (scrolled_down) { diff --git a/Userland/Applications/Piano/RollWidget.cpp b/Userland/Applications/Piano/RollWidget.cpp index 190b6d81a0..23dad13867 100644 --- a/Userland/Applications/Piano/RollWidget.cpp +++ b/Userland/Applications/Piano/RollWidget.cpp @@ -239,7 +239,12 @@ void RollWidget::mouseup_event([[maybe_unused]] GUI::MouseEvent& event) void RollWidget::mousewheel_event(GUI::MouseEvent& event) { if (event.modifiers() & KeyModifier::Mod_Shift) { - horizontal_scrollbar().increase_slider_by(event.wheel_delta() * horizontal_scroll_sensitivity); + horizontal_scrollbar().increase_slider_by(event.wheel_delta_y() * horizontal_scroll_sensitivity); + return; + } + + if (event.wheel_delta_x() != 0) { + horizontal_scrollbar().increase_slider_by(event.wheel_delta_x() * horizontal_scroll_sensitivity); return; } @@ -248,7 +253,7 @@ void RollWidget::mousewheel_event(GUI::MouseEvent& event) return; } - double multiplier = event.wheel_delta() >= 0 ? 0.5 : 2; + double multiplier = event.wheel_delta_y() >= 0 ? 0.5 : 2; if (m_zoom_level * multiplier > max_zoom) return; diff --git a/Userland/Applications/PixelPaint/ImageEditor.cpp b/Userland/Applications/PixelPaint/ImageEditor.cpp index a9699e131c..d4b7964f86 100644 --- a/Userland/Applications/PixelPaint/ImageEditor.cpp +++ b/Userland/Applications/PixelPaint/ImageEditor.cpp @@ -257,7 +257,8 @@ GUI::MouseEvent ImageEditor::event_with_pan_and_scale_applied(GUI::MouseEvent co event.buttons(), event.button(), event.modifiers(), - event.wheel_delta() + event.wheel_delta_x(), + event.wheel_delta_y(), }; } @@ -271,7 +272,8 @@ GUI::MouseEvent ImageEditor::event_adjusted_for_layer(GUI::MouseEvent const& eve event.buttons(), event.button(), event.modifiers(), - event.wheel_delta() + event.wheel_delta_x(), + event.wheel_delta_y(), }; } diff --git a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp index a90ae7841b..149baddc19 100644 --- a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp +++ b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp @@ -316,8 +316,8 @@ void TreeMapWidget::doubleclick_event(GUI::MouseEvent& event) void TreeMapWidget::mousewheel_event(GUI::MouseEvent& event) { - int delta = event.wheel_delta(); - // FIXME: The wheel_delta is premultiplied in the window server, we actually want a raw value here. + int delta = event.wheel_delta_y(); + // FIXME: The wheel_delta_y is premultiplied in the window server, we actually want a raw value here. int step_size = GUI::WindowServerConnection::the().get_scroll_step_size(); if (delta > 0) { size_t step_back = delta / step_size; diff --git a/Userland/Demos/Mandelbrot/Mandelbrot.cpp b/Userland/Demos/Mandelbrot/Mandelbrot.cpp index e37406aadc..1d06224447 100644 --- a/Userland/Demos/Mandelbrot/Mandelbrot.cpp +++ b/Userland/Demos/Mandelbrot/Mandelbrot.cpp @@ -350,7 +350,7 @@ void Mandelbrot::mouseup_event(GUI::MouseEvent& event) void Mandelbrot::mousewheel_event(GUI::MouseEvent& event) { - zoom(event.wheel_delta() < 0 ? Zoom::In : Zoom::Out, event.position()); + zoom(event.wheel_delta_y() < 0 ? Zoom::In : Zoom::Out, event.position()); } void Mandelbrot::resize_event(GUI::ResizeEvent& event) diff --git a/Userland/Demos/Mouse/main.cpp b/Userland/Demos/Mouse/main.cpp index 87d1e68761..1a739e8e78 100644 --- a/Userland/Demos/Mouse/main.cpp +++ b/Userland/Demos/Mouse/main.cpp @@ -138,7 +138,7 @@ public: void mousewheel_event(GUI::MouseEvent& event) override { - m_wheel_delta_acc = (m_wheel_delta_acc + event.wheel_delta() + 36) % 36; + m_wheel_delta_acc = (m_wheel_delta_acc + event.wheel_delta_y() + 36) % 36; m_show_scroll_wheel = true; update(); if (!has_timer()) diff --git a/Userland/DevTools/Profiler/TimelineView.cpp b/Userland/DevTools/Profiler/TimelineView.cpp index e8cc208aac..bc34d0fb25 100644 --- a/Userland/DevTools/Profiler/TimelineView.cpp +++ b/Userland/DevTools/Profiler/TimelineView.cpp @@ -67,7 +67,7 @@ void TimelineView::mousewheel_event(GUI::MouseEvent& event) { if (event.modifiers() == Mod_Ctrl) { event.accept(); - m_scale += event.wheel_delta(); + m_scale += event.wheel_delta_y(); m_scale = clamp(m_scale, 1.0f, 100.0f); for_each_child_of_type<TimelineTrack>([&](auto& track) { track.set_scale(m_scale); diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp index 963f230c7d..77ec27eda2 100644 --- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp +++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp @@ -47,11 +47,26 @@ void AbstractScrollableWidget::handle_wheel_event(MouseEvent& event, Widget& eve event.ignore(); return; } - // FIXME: The wheel delta multiplier should probably come from... somewhere? + + int wheel_delta_x { 0 }; + bool vertical_scroll_hijacked { false }; + if (event.shift() || &event_source == m_horizontal_scrollbar.ptr()) { - horizontal_scrollbar().increase_slider_by(event.wheel_delta() * 60); - } else { - vertical_scrollbar().increase_slider_by(event.wheel_delta() * 20); + wheel_delta_x = event.wheel_delta_y(); + vertical_scroll_hijacked = true; + } + + if (event.wheel_delta_x() != 0) { + wheel_delta_x = event.wheel_delta_x(); + } + + if (wheel_delta_x != 0) { + // FIXME: The wheel delta multiplier should probably come from... somewhere? + horizontal_scrollbar().increase_slider_by(wheel_delta_x * 60); + } + + if (!vertical_scroll_hijacked && event.wheel_delta_y() != 0) { + vertical_scrollbar().increase_slider_by(event.wheel_delta_y() * 20); } } @@ -283,5 +298,4 @@ Gfx::IntPoint AbstractScrollableWidget::to_widget_position(const Gfx::IntPoint& widget_position.translate_by(frame_thickness(), frame_thickness()); return widget_position; } - } diff --git a/Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp b/Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp index 91e0b488a0..43c0add6bc 100644 --- a/Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp +++ b/Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp @@ -111,7 +111,7 @@ Gfx::FloatRect AbstractZoomPanWidget::content_to_frame_rect(Gfx::IntRect const& void AbstractZoomPanWidget::mousewheel_event(GUI::MouseEvent& event) { - float new_scale = scale() / AK::exp2(event.wheel_delta() / wheel_zoom_factor); + float new_scale = scale() / AK::exp2(event.wheel_delta_y() / wheel_zoom_factor); scale_centered(new_scale, event.position()); } diff --git a/Userland/Libraries/LibGUI/ComboBox.cpp b/Userland/Libraries/LibGUI/ComboBox.cpp index ec86eeec6c..8060764999 100644 --- a/Userland/Libraries/LibGUI/ComboBox.cpp +++ b/Userland/Libraries/LibGUI/ComboBox.cpp @@ -36,7 +36,7 @@ private: if (!is_focused()) set_focus(true); if (on_mousewheel) - on_mousewheel(event.wheel_delta()); + on_mousewheel(event.wheel_delta_y()); } virtual void keydown_event(KeyEvent& event) override diff --git a/Userland/Libraries/LibGUI/Event.h b/Userland/Libraries/LibGUI/Event.h index bc1a859914..517650493e 100644 --- a/Userland/Libraries/LibGUI/Event.h +++ b/Userland/Libraries/LibGUI/Event.h @@ -370,13 +370,14 @@ private: class MouseEvent final : public Event { public: - MouseEvent(Type type, const Gfx::IntPoint& position, unsigned buttons, MouseButton button, unsigned modifiers, int wheel_delta) + MouseEvent(Type type, const Gfx::IntPoint& position, unsigned buttons, MouseButton button, unsigned modifiers, int wheel_delta_x, int wheel_delta_y) : Event(type) , m_position(position) , m_buttons(buttons) , m_button(button) , m_modifiers(modifiers) - , m_wheel_delta(wheel_delta) + , m_wheel_delta_x(wheel_delta_x) + , m_wheel_delta_y(wheel_delta_y) { } @@ -390,14 +391,16 @@ public: bool shift() const { return m_modifiers & Mod_Shift; } bool super() const { return m_modifiers & Mod_Super; } unsigned modifiers() const { return m_modifiers; } - int wheel_delta() const { return m_wheel_delta; } + int wheel_delta_x() const { return m_wheel_delta_x; } + int wheel_delta_y() const { return m_wheel_delta_y; } private: Gfx::IntPoint m_position; unsigned m_buttons { 0 }; MouseButton m_button { MouseButton::None }; unsigned m_modifiers { 0 }; - int m_wheel_delta { 0 }; + int m_wheel_delta_x { 0 }; + int m_wheel_delta_y { 0 }; }; class DragEvent final : public Event { diff --git a/Userland/Libraries/LibGUI/OpacitySlider.cpp b/Userland/Libraries/LibGUI/OpacitySlider.cpp index d8cc98e457..be578c0f0e 100644 --- a/Userland/Libraries/LibGUI/OpacitySlider.cpp +++ b/Userland/Libraries/LibGUI/OpacitySlider.cpp @@ -139,7 +139,7 @@ void OpacitySlider::mouseup_event(MouseEvent& event) void OpacitySlider::mousewheel_event(MouseEvent& event) { - decrease_slider_by(event.wheel_delta()); + decrease_slider_by(event.wheel_delta_y()); } } diff --git a/Userland/Libraries/LibGUI/Scrollbar.cpp b/Userland/Libraries/LibGUI/Scrollbar.cpp index 7268a48b98..6d05917962 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.cpp +++ b/Userland/Libraries/LibGUI/Scrollbar.cpp @@ -299,7 +299,7 @@ void Scrollbar::mousewheel_event(MouseEvent& event) { if (!is_scrollable()) return; - increase_slider_by_steps(event.wheel_delta()); + increase_slider_by_steps(event.wheel_delta_y()); Widget::mousewheel_event(event); } diff --git a/Userland/Libraries/LibGUI/Slider.cpp b/Userland/Libraries/LibGUI/Slider.cpp index 15998aa433..333a194144 100644 --- a/Userland/Libraries/LibGUI/Slider.cpp +++ b/Userland/Libraries/LibGUI/Slider.cpp @@ -139,7 +139,7 @@ void Slider::mouseup_event(MouseEvent& event) void Slider::mousewheel_event(MouseEvent& event) { auto acceleration_modifier = step(); - auto wheel_delta = event.wheel_delta(); + auto wheel_delta = event.wheel_delta_y(); if (event.modifiers() == KeyModifier::Mod_Ctrl) acceleration_modifier *= 6; diff --git a/Userland/Libraries/LibGUI/SpinBox.cpp b/Userland/Libraries/LibGUI/SpinBox.cpp index 8036ee6e98..ad988d4681 100644 --- a/Userland/Libraries/LibGUI/SpinBox.cpp +++ b/Userland/Libraries/LibGUI/SpinBox.cpp @@ -87,7 +87,7 @@ void SpinBox::set_range(int min, int max, AllowCallback allow_callback) void SpinBox::mousewheel_event(MouseEvent& event) { - auto wheel_delta = event.wheel_delta() / abs(event.wheel_delta()); + auto wheel_delta = event.wheel_delta_y() / abs(event.wheel_delta_y()); if (event.modifiers() == KeyModifier::Mod_Ctrl) wheel_delta *= 6; set_value(m_value - wheel_delta); diff --git a/Userland/Libraries/LibGUI/ValueSlider.cpp b/Userland/Libraries/LibGUI/ValueSlider.cpp index c1fd24b257..42e09f0be7 100644 --- a/Userland/Libraries/LibGUI/ValueSlider.cpp +++ b/Userland/Libraries/LibGUI/ValueSlider.cpp @@ -162,7 +162,7 @@ void ValueSlider::leave_event(Core::Event&) void ValueSlider::mousewheel_event(MouseEvent& event) { - if (event.wheel_delta() < 0) + if (event.wheel_delta_y() < 0) increase_slider_by(1); else decrease_slider_by(1); diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp index d9b74a57e2..539fc680c2 100644 --- a/Userland/Libraries/LibGUI/Window.cpp +++ b/Userland/Libraries/LibGUI/Window.cpp @@ -366,7 +366,7 @@ void Window::handle_mouse_event(MouseEvent& event) if (m_automatic_cursor_tracking_widget) { auto window_relative_rect = m_automatic_cursor_tracking_widget->window_relative_rect(); Gfx::IntPoint local_point { event.x() - window_relative_rect.x(), event.y() - window_relative_rect.y() }; - auto local_event = MouseEvent((Event::Type)event.type(), local_point, event.buttons(), event.button(), event.modifiers(), event.wheel_delta()); + auto local_event = MouseEvent((Event::Type)event.type(), local_point, event.buttons(), event.button(), event.modifiers(), event.wheel_delta_x(), event.wheel_delta_y()); m_automatic_cursor_tracking_widget->dispatch_event(local_event, this); if (event.buttons() == 0) m_automatic_cursor_tracking_widget = nullptr; @@ -375,7 +375,7 @@ void Window::handle_mouse_event(MouseEvent& event) if (!m_main_widget) return; auto result = m_main_widget->hit_test(event.position()); - auto local_event = MouseEvent((Event::Type)event.type(), result.local_position, event.buttons(), event.button(), event.modifiers(), event.wheel_delta()); + auto local_event = MouseEvent((Event::Type)event.type(), result.local_position, event.buttons(), event.button(), event.modifiers(), event.wheel_delta_x(), event.wheel_delta_y()); VERIFY(result.widget); set_hovered_widget(result.widget); if (event.buttons() != 0 && !m_automatic_cursor_tracking_widget) diff --git a/Userland/Libraries/LibGUI/WindowServerConnection.cpp b/Userland/Libraries/LibGUI/WindowServerConnection.cpp index 60490a4129..75812ed9e5 100644 --- a/Userland/Libraries/LibGUI/WindowServerConnection.cpp +++ b/Userland/Libraries/LibGUI/WindowServerConnection.cpp @@ -228,38 +228,38 @@ static MouseButton to_mouse_button(u32 button) } } -void WindowServerConnection::mouse_down(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta) +void WindowServerConnection::mouse_down(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) { if (auto* window = Window::from_window_id(window_id)) - Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseDown, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta)); + Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseDown, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta_x, wheel_delta_y)); } -void WindowServerConnection::mouse_up(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta) +void WindowServerConnection::mouse_up(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) { if (auto* window = Window::from_window_id(window_id)) - Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseUp, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta)); + Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseUp, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta_x, wheel_delta_y)); } -void WindowServerConnection::mouse_move(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta, bool is_drag, Vector<String> const& mime_types) +void WindowServerConnection::mouse_move(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, bool is_drag, Vector<String> const& mime_types) { if (auto* window = Window::from_window_id(window_id)) { if (is_drag) Core::EventLoop::current().post_event(*window, make<DragEvent>(Event::DragMove, mouse_position, mime_types)); else - Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseMove, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta)); + Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseMove, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta_x, wheel_delta_y)); } } -void WindowServerConnection::mouse_double_click(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta) +void WindowServerConnection::mouse_double_click(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) { if (auto* window = Window::from_window_id(window_id)) - Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseDoubleClick, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta)); + Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseDoubleClick, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta_x, wheel_delta_y)); } -void WindowServerConnection::mouse_wheel(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta) +void WindowServerConnection::mouse_wheel(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) { if (auto* window = Window::from_window_id(window_id)) - Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseWheel, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta)); + Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseWheel, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta_x, wheel_delta_y)); } void WindowServerConnection::menu_visibility_did_change(i32 menu_id, bool visible) diff --git a/Userland/Libraries/LibGUI/WindowServerConnection.h b/Userland/Libraries/LibGUI/WindowServerConnection.h index 24adb18407..e5a9b79901 100644 --- a/Userland/Libraries/LibGUI/WindowServerConnection.h +++ b/Userland/Libraries/LibGUI/WindowServerConnection.h @@ -26,11 +26,11 @@ private: virtual void fast_greet(Vector<Gfx::IntRect> const&, u32, u32, u32, Core::AnonymousBuffer const&, String const&, String const&, i32) override; virtual void paint(i32, Gfx::IntSize const&, Vector<Gfx::IntRect> const&) override; - virtual void mouse_move(i32, Gfx::IntPoint const&, u32, u32, u32, i32, bool, Vector<String> const&) override; - virtual void mouse_down(i32, Gfx::IntPoint const&, u32, u32, u32, i32) override; - virtual void mouse_double_click(i32, Gfx::IntPoint const&, u32, u32, u32, i32) override; - virtual void mouse_up(i32, Gfx::IntPoint const&, u32, u32, u32, i32) override; - virtual void mouse_wheel(i32, Gfx::IntPoint const&, u32, u32, u32, i32) override; + virtual void mouse_move(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32, bool, Vector<String> const&) override; + virtual void mouse_down(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32) override; + virtual void mouse_double_click(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32) override; + virtual void mouse_up(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32) override; + virtual void mouse_wheel(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32) override; virtual void window_entered(i32) override; virtual void window_left(i32) override; virtual void key_down(i32, u32, u32, u32, u32) override; diff --git a/Userland/Libraries/LibVT/TerminalWidget.cpp b/Userland/Libraries/LibVT/TerminalWidget.cpp index c3108d3d3f..8bfe60fed4 100644 --- a/Userland/Libraries/LibVT/TerminalWidget.cpp +++ b/Userland/Libraries/LibVT/TerminalWidget.cpp @@ -918,7 +918,7 @@ void TerminalWidget::mousewheel_event(GUI::MouseEvent& event) if (!is_scrollable()) return; set_auto_scroll_direction(AutoScrollDirection::None); - m_scrollbar->increase_slider_by(event.wheel_delta() * scroll_length()); + m_scrollbar->increase_slider_by(event.wheel_delta_y() * scroll_length()); GUI::Frame::mousewheel_event(event); } diff --git a/Userland/Libraries/LibWeb/InProcessWebView.cpp b/Userland/Libraries/LibWeb/InProcessWebView.cpp index 88cf8e9a9a..040f220be1 100644 --- a/Userland/Libraries/LibWeb/InProcessWebView.cpp +++ b/Userland/Libraries/LibWeb/InProcessWebView.cpp @@ -237,7 +237,7 @@ void InProcessWebView::mouseup_event(GUI::MouseEvent& event) void InProcessWebView::mousewheel_event(GUI::MouseEvent& event) { - page().handle_mousewheel(to_content_position(event.position()), event.button(), event.modifiers(), event.wheel_delta()); + page().handle_mousewheel(to_content_position(event.position()), event.button(), event.modifiers(), event.wheel_delta_x(), event.wheel_delta_y()); GUI::AbstractScrollableWidget::mousewheel_event(event); } diff --git a/Userland/Libraries/LibWeb/Layout/BlockContainer.cpp b/Userland/Libraries/LibWeb/Layout/BlockContainer.cpp index a22981a9fe..5bbc155f22 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockContainer.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockContainer.cpp @@ -136,12 +136,12 @@ void BlockContainer::set_scroll_offset(const Gfx::FloatPoint& offset) set_needs_display(); } -bool BlockContainer::handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned int, unsigned int, int wheel_delta) +bool BlockContainer::handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned int, unsigned int, int wheel_delta_x, int wheel_delta_y) { if (!is_scrollable()) return false; auto new_offset = m_scroll_offset; - new_offset.translate_by(0, wheel_delta); + new_offset.translate_by(wheel_delta_x, wheel_delta_y); set_scroll_offset(new_offset); return true; diff --git a/Userland/Libraries/LibWeb/Layout/BlockContainer.h b/Userland/Libraries/LibWeb/Layout/BlockContainer.h index 0fa3e2aacd..397a262917 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockContainer.h +++ b/Userland/Libraries/LibWeb/Layout/BlockContainer.h @@ -50,7 +50,7 @@ protected: private: virtual bool is_block_container() const final { return true; } virtual bool wants_mouse_events() const override { return false; } - virtual bool handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned buttons, unsigned modifiers, int wheel_delta) override; + virtual bool handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y) override; bool should_clip_overflow() const; diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index be8bd5e9cc..d2a0f8b460 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -494,13 +494,13 @@ void Node::handle_mousemove(Badge<EventHandler>, const Gfx::IntPoint&, unsigned, { } -bool Node::handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned, unsigned, int wheel_delta) +bool Node::handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y) { if (auto* containing_block = this->containing_block()) { if (!containing_block->is_scrollable()) return false; auto new_offset = containing_block->scroll_offset(); - new_offset.translate_by(0, wheel_delta); + new_offset.translate_by(wheel_delta_x, wheel_delta_y); containing_block->set_scroll_offset(new_offset); return true; } diff --git a/Userland/Libraries/LibWeb/Layout/Node.h b/Userland/Libraries/LibWeb/Layout/Node.h index 3a6a90a009..bcf67189b9 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.h +++ b/Userland/Libraries/LibWeb/Layout/Node.h @@ -89,7 +89,7 @@ public: virtual void handle_mousedown(Badge<EventHandler>, const Gfx::IntPoint&, unsigned button, unsigned modifiers); virtual void handle_mouseup(Badge<EventHandler>, const Gfx::IntPoint&, unsigned button, unsigned modifiers); virtual void handle_mousemove(Badge<EventHandler>, const Gfx::IntPoint&, unsigned buttons, unsigned modifiers); - virtual bool handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned buttons, unsigned modifiers, int wheel_delta); + virtual bool handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y); virtual void before_children_paint(PaintContext&, PaintPhase) {}; virtual void paint(PaintContext&, PaintPhase) = 0; diff --git a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp index b9390ca618..c1f4470cd8 100644 --- a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp +++ b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp @@ -183,7 +183,7 @@ void OutOfProcessWebView::mousemove_event(GUI::MouseEvent& event) 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()); + 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::theme_change_event(GUI::ThemeChangeEvent& event) diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index 146639c7ac..a254df2bd4 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -112,7 +112,7 @@ Layout::InitialContainingBlock* EventHandler::layout_root() return m_frame.active_document()->layout_node(); } -bool EventHandler::handle_mousewheel(const Gfx::IntPoint& position, unsigned int buttons, unsigned int modifiers, int wheel_delta) +bool EventHandler::handle_mousewheel(const Gfx::IntPoint& position, unsigned int buttons, unsigned int modifiers, int wheel_delta_x, int wheel_delta_y) { if (!layout_root()) return false; @@ -121,12 +121,12 @@ bool EventHandler::handle_mousewheel(const Gfx::IntPoint& position, unsigned int auto result = layout_root()->hit_test(position, Layout::HitTestType::Exact); if (result.layout_node) { - if (result.layout_node->handle_mousewheel({}, position, buttons, modifiers, wheel_delta)) + if (result.layout_node->handle_mousewheel({}, position, buttons, modifiers, wheel_delta_x, wheel_delta_y)) return true; } if (auto* page = m_frame.page()) { - page->client().page_did_request_scroll(0, wheel_delta * 20); + page->client().page_did_request_scroll(wheel_delta_x * 20, wheel_delta_y * 20); return true; } diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.h b/Userland/Libraries/LibWeb/Page/EventHandler.h index 402696036a..b4730b03e1 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.h +++ b/Userland/Libraries/LibWeb/Page/EventHandler.h @@ -25,7 +25,7 @@ public: bool handle_mouseup(const Gfx::IntPoint&, unsigned button, unsigned modifiers); bool handle_mousedown(const Gfx::IntPoint&, unsigned button, unsigned modifiers); bool handle_mousemove(const Gfx::IntPoint&, unsigned buttons, unsigned modifiers); - bool handle_mousewheel(const Gfx::IntPoint&, unsigned buttons, unsigned modifiers, int wheel_delta); + bool handle_mousewheel(const Gfx::IntPoint&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y); bool handle_keydown(KeyCode, unsigned modifiers, u32 code_point); bool handle_keyup(KeyCode, unsigned modifiers, u32 code_point); diff --git a/Userland/Libraries/LibWeb/Page/Page.cpp b/Userland/Libraries/LibWeb/Page/Page.cpp index d033a9a799..64fd74229b 100644 --- a/Userland/Libraries/LibWeb/Page/Page.cpp +++ b/Userland/Libraries/LibWeb/Page/Page.cpp @@ -61,9 +61,9 @@ CSS::PreferredColorScheme Page::preferred_color_scheme() const return m_client.preferred_color_scheme(); } -bool Page::handle_mousewheel(const Gfx::IntPoint& position, unsigned button, unsigned modifiers, int wheel_delta) +bool Page::handle_mousewheel(const Gfx::IntPoint& position, unsigned button, unsigned modifiers, int wheel_delta_x, int wheel_delta_y) { - return top_level_browsing_context().event_handler().handle_mousewheel(position, button, modifiers, wheel_delta); + return top_level_browsing_context().event_handler().handle_mousewheel(position, button, modifiers, wheel_delta_x, wheel_delta_y); } bool Page::handle_mouseup(const Gfx::IntPoint& position, unsigned button, unsigned modifiers) diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h index 9939e6644f..f0c3bcb259 100644 --- a/Userland/Libraries/LibWeb/Page/Page.h +++ b/Userland/Libraries/LibWeb/Page/Page.h @@ -50,7 +50,7 @@ public: bool handle_mouseup(const Gfx::IntPoint&, unsigned button, unsigned modifiers); bool handle_mousedown(const Gfx::IntPoint&, unsigned button, unsigned modifiers); bool handle_mousemove(const Gfx::IntPoint&, unsigned buttons, unsigned modifiers); - bool handle_mousewheel(const Gfx::IntPoint&, unsigned button, unsigned modifiers, int wheel_delta); + bool handle_mousewheel(const Gfx::IntPoint&, unsigned button, unsigned modifiers, int wheel_delta_x, int wheel_delta_y); bool handle_keydown(KeyCode, unsigned modifiers, u32 code_point); bool handle_keyup(KeyCode, unsigned modifiers, u32 code_point); diff --git a/Userland/Services/Taskbar/TaskbarWindow.cpp b/Userland/Services/Taskbar/TaskbarWindow.cpp index 02279520b2..9e0614e4c8 100644 --- a/Userland/Services/Taskbar/TaskbarWindow.cpp +++ b/Userland/Services/Taskbar/TaskbarWindow.cpp @@ -211,7 +211,7 @@ void TaskbarWindow::event(Core::Event& event) if (adjusted_point != mouse_event.position()) { GUI::WindowServerConnection::the().async_set_global_cursor_position(position() + adjusted_point); - GUI::MouseEvent adjusted_event = { (GUI::Event::Type)mouse_event.type(), adjusted_point, mouse_event.buttons(), mouse_event.button(), mouse_event.modifiers(), mouse_event.wheel_delta() }; + GUI::MouseEvent adjusted_event = { (GUI::Event::Type)mouse_event.type(), adjusted_point, mouse_event.buttons(), mouse_event.button(), mouse_event.modifiers(), mouse_event.wheel_delta_x(), mouse_event.wheel_delta_y() }; Window::event(adjusted_event); return; } diff --git a/Userland/Services/WebContent/ClientConnection.cpp b/Userland/Services/WebContent/ClientConnection.cpp index facf01ca00..f7221caab9 100644 --- a/Userland/Services/WebContent/ClientConnection.cpp +++ b/Userland/Services/WebContent/ClientConnection.cpp @@ -154,9 +154,9 @@ void ClientConnection::mouse_up(const Gfx::IntPoint& position, unsigned int butt page().handle_mouseup(position, button, modifiers); } -void ClientConnection::mouse_wheel(const Gfx::IntPoint& position, unsigned int button, [[maybe_unused]] unsigned int buttons, unsigned int modifiers, i32 wheel_delta) +void ClientConnection::mouse_wheel(const Gfx::IntPoint& position, unsigned int button, [[maybe_unused]] unsigned int buttons, unsigned int modifiers, i32 wheel_delta_x, i32 wheel_delta_y) { - page().handle_mousewheel(position, button, modifiers, wheel_delta); + page().handle_mousewheel(position, button, modifiers, wheel_delta_x, wheel_delta_y); } void ClientConnection::key_down(i32 key, unsigned int modifiers, u32 code_point) diff --git a/Userland/Services/WebContent/ClientConnection.h b/Userland/Services/WebContent/ClientConnection.h index 833b45d460..419e42d094 100644 --- a/Userland/Services/WebContent/ClientConnection.h +++ b/Userland/Services/WebContent/ClientConnection.h @@ -47,7 +47,7 @@ private: virtual void mouse_down(Gfx::IntPoint const&, unsigned, unsigned, unsigned) override; virtual void mouse_move(Gfx::IntPoint const&, unsigned, unsigned, unsigned) override; virtual void mouse_up(Gfx::IntPoint const&, unsigned, unsigned, unsigned) override; - virtual void mouse_wheel(Gfx::IntPoint const&, unsigned, unsigned, unsigned, i32) override; + virtual void mouse_wheel(Gfx::IntPoint const&, unsigned, unsigned, unsigned, i32, i32) override; virtual void key_down(i32, unsigned, u32) override; virtual void key_up(i32, unsigned, u32) override; virtual void add_backing_store(i32, Gfx::ShareableBitmap const&) override; diff --git a/Userland/Services/WebContent/WebContentServer.ipc b/Userland/Services/WebContent/WebContentServer.ipc index fe179bf270..dc03a7a853 100644 --- a/Userland/Services/WebContent/WebContentServer.ipc +++ b/Userland/Services/WebContent/WebContentServer.ipc @@ -21,7 +21,7 @@ endpoint WebContentServer mouse_down(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers) =| mouse_move(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers) =| mouse_up(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers) =| - mouse_wheel(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers, i32 wheel_delta) =| + mouse_wheel(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers, i32 wheel_delta_x, i32 wheel_delta_y) =| key_down(i32 key, unsigned modifiers, u32 code_point) =| key_up(i32 key, unsigned modifiers, u32 code_point) =| diff --git a/Userland/Services/WindowServer/Event.h b/Userland/Services/WindowServer/Event.h index 2d535ed8d7..18aaf0af5d 100644 --- a/Userland/Services/WindowServer/Event.h +++ b/Userland/Services/WindowServer/Event.h @@ -88,13 +88,14 @@ private: class MouseEvent final : public Event { public: - MouseEvent(Type type, const Gfx::IntPoint& position, unsigned buttons, MouseButton button, unsigned modifiers, int wheel_delta = 0) + MouseEvent(Type type, const Gfx::IntPoint& position, unsigned buttons, MouseButton button, unsigned modifiers, int wheel_delta_x = 0, int wheel_delta_y = 0) : Event(type) , m_position(position) , m_buttons(buttons) , m_button(button) , m_modifiers(modifiers) - , m_wheel_delta(wheel_delta) + , m_wheel_delta_x(wheel_delta_x) + , m_wheel_delta_y(wheel_delta_y) { } @@ -104,7 +105,8 @@ public: MouseButton button() const { return m_button; } unsigned buttons() const { return m_buttons; } unsigned modifiers() const { return m_modifiers; } - int wheel_delta() const { return m_wheel_delta; } + int wheel_delta_x() const { return m_wheel_delta_x; } + int wheel_delta_y() const { return m_wheel_delta_y; } bool is_drag() const { return m_drag; } Vector<String> mime_types() const @@ -129,7 +131,8 @@ private: unsigned m_buttons { 0 }; MouseButton m_button { MouseButton::None }; unsigned m_modifiers { 0 }; - int m_wheel_delta { 0 }; + int m_wheel_delta_x { 0 }; + int m_wheel_delta_y { 0 }; bool m_drag { false }; RefPtr<const Core::MimeData> m_mime_data; }; diff --git a/Userland/Services/WindowServer/Menu.cpp b/Userland/Services/WindowServer/Menu.cpp index 43daeb02e8..67c692bda6 100644 --- a/Userland/Services/WindowServer/Menu.cpp +++ b/Userland/Services/WindowServer/Menu.cpp @@ -393,7 +393,7 @@ void Menu::event(Core::Event& event) VERIFY(menu_window()); auto& mouse_event = static_cast<const MouseEvent&>(event); auto previous_scroll_offset = m_scroll_offset; - m_scroll_offset += mouse_event.wheel_delta(); + m_scroll_offset += mouse_event.wheel_delta_y(); m_scroll_offset = clamp(m_scroll_offset, 0, m_max_scroll_offset); if (m_scroll_offset != previous_scroll_offset) redraw(); diff --git a/Userland/Services/WindowServer/Screen.cpp b/Userland/Services/WindowServer/Screen.cpp index 6a0a6e4d40..2bc492bdb4 100644 --- a/Userland/Services/WindowServer/Screen.cpp +++ b/Userland/Services/WindowServer/Screen.cpp @@ -461,8 +461,8 @@ void ScreenInput::on_receive_mouse_data(const MousePacket& packet) Core::EventLoop::current().post_event(WindowManager::the(), move(message)); } - if (packet.z) { - auto message = make<MouseEvent>(Event::MouseWheel, m_cursor_location, buttons, MouseButton::None, m_modifiers, packet.z * m_scroll_step_size); + if (packet.z || packet.w) { + auto message = make<MouseEvent>(Event::MouseWheel, m_cursor_location, buttons, MouseButton::None, m_modifiers, packet.w * m_scroll_step_size, packet.z * m_scroll_step_size); Core::EventLoop::current().post_event(WindowManager::the(), move(message)); } diff --git a/Userland/Services/WindowServer/Window.cpp b/Userland/Services/WindowServer/Window.cpp index ae1840ffe5..b072da2ecf 100644 --- a/Userland/Services/WindowServer/Window.cpp +++ b/Userland/Services/WindowServer/Window.cpp @@ -264,19 +264,19 @@ void Window::handle_mouse_event(const MouseEvent& event) switch (event.type()) { case Event::MouseMove: - m_client->async_mouse_move(m_window_id, event.position(), (u32)event.button(), event.buttons(), event.modifiers(), event.wheel_delta(), event.is_drag(), event.mime_types()); + m_client->async_mouse_move(m_window_id, event.position(), (u32)event.button(), event.buttons(), event.modifiers(), event.wheel_delta_x(), event.wheel_delta_y(), event.is_drag(), event.mime_types()); break; case Event::MouseDown: - m_client->async_mouse_down(m_window_id, event.position(), (u32)event.button(), event.buttons(), event.modifiers(), event.wheel_delta()); + m_client->async_mouse_down(m_window_id, event.position(), (u32)event.button(), event.buttons(), event.modifiers(), event.wheel_delta_x(), event.wheel_delta_y()); break; case Event::MouseDoubleClick: - m_client->async_mouse_double_click(m_window_id, event.position(), (u32)event.button(), event.buttons(), event.modifiers(), event.wheel_delta()); + m_client->async_mouse_double_click(m_window_id, event.position(), (u32)event.button(), event.buttons(), event.modifiers(), event.wheel_delta_x(), event.wheel_delta_y()); break; case Event::MouseUp: - m_client->async_mouse_up(m_window_id, event.position(), (u32)event.button(), event.buttons(), event.modifiers(), event.wheel_delta()); + m_client->async_mouse_up(m_window_id, event.position(), (u32)event.button(), event.buttons(), event.modifiers(), event.wheel_delta_x(), event.wheel_delta_y()); break; case Event::MouseWheel: - m_client->async_mouse_wheel(m_window_id, event.position(), (u32)event.button(), event.buttons(), event.modifiers(), event.wheel_delta()); + m_client->async_mouse_wheel(m_window_id, event.position(), (u32)event.button(), event.buttons(), event.modifiers(), event.wheel_delta_x(), event.wheel_delta_y()); break; default: VERIFY_NOT_REACHED(); diff --git a/Userland/Services/WindowServer/WindowClient.ipc b/Userland/Services/WindowServer/WindowClient.ipc index 29c5cacaf9..c144c7162b 100644 --- a/Userland/Services/WindowServer/WindowClient.ipc +++ b/Userland/Services/WindowServer/WindowClient.ipc @@ -6,11 +6,11 @@ endpoint WindowClient fast_greet(Vector<Gfx::IntRect> screen_rects, u32 main_screen_index, u32 workspace_rows, u32 workspace_columns, Core::AnonymousBuffer theme_buffer, String default_font_query, String fixed_width_font_query, i32 client_id) =| paint(i32 window_id, Gfx::IntSize window_size, Vector<Gfx::IntRect> rects) =| - mouse_move(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta, bool is_drag, Vector<String> mime_types) =| - mouse_down(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta) =| - mouse_double_click(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta) =| - mouse_up(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta) =| - mouse_wheel(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta) =| + mouse_move(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, bool is_drag, Vector<String> mime_types) =| + mouse_down(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) =| + mouse_double_click(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) =| + mouse_up(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) =| + mouse_wheel(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) =| window_entered(i32 window_id) =| window_left(i32 window_id) =| window_input_entered(i32 window_id) =| diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index 3da8bc651d..d263b09603 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -1099,7 +1099,7 @@ void WindowManager::process_event_for_doubleclick(Window& window, MouseEvent& ev } else { dbgln_if(DOUBLECLICK_DEBUG, "Transforming MouseUp to MouseDoubleClick ({} < {})!", metadata.clock.elapsed(), m_double_click_speed); - event = MouseEvent(Event::MouseDoubleClick, event.position(), event.buttons(), event.button(), event.modifiers(), event.wheel_delta()); + event = MouseEvent(Event::MouseDoubleClick, event.position(), event.buttons(), event.button(), event.modifiers(), event.wheel_delta_x(), event.wheel_delta_y()); // invalidate this now we've delivered a doubleclick, otherwise // tripleclick will deliver two doubleclick events (incorrectly). metadata.clock = {}; |