Skip to content

Commit

Permalink
Fix mouse scroll events firing twice
Browse files Browse the repository at this point in the history
  • Loading branch information
LupertEverett authored and dpjudas committed Nov 19, 2024
1 parent a06a8ee commit 3ec8761
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,15 +353,14 @@ void WaylandDisplayBackend::ConnectDeviceEvents()
if (!currentPointerEvent.axes[idx].valid)
continue;

if (currentPointerEvent.event_mask & POINTER_EVENT_AXIS)
if (currentPointerEvent.event_mask & POINTER_EVENT_AXIS_120)
{
if (idx == uint32_t(wayland::pointer_axis::vertical_scroll) && currentPointerEvent.axes[idx].value > 0)
OnMouseWheelEvent(InputKey::MouseWheelDown);
if (idx == uint32_t(wayland::pointer_axis::vertical_scroll) && currentPointerEvent.axes[idx].value < 0)
OnMouseWheelEvent(InputKey::MouseWheelUp);
}

if (currentPointerEvent.event_mask & POINTER_EVENT_AXIS_120)
else if (currentPointerEvent.event_mask & POINTER_EVENT_AXIS)
{
if (idx == uint32_t(wayland::pointer_axis::vertical_scroll) && currentPointerEvent.axes[idx].value120 > 0)
OnMouseWheelEvent(InputKey::MouseWheelDown);
Expand Down

0 comments on commit 3ec8761

Please sign in to comment.