Fixed #6087: Inconsistend scroll on wayland

Thanks to @yol and @SaschaWessel a bug in scroll step conversion
was uncovered. The RDP value ranges are inverted when scrolling
in negative direction.
This commit is contained in:
akallabeth 2020-05-01 10:26:18 +02:00 committed by akallabeth
parent fe8bad1698
commit 77b38d9375

View File

@ -171,9 +171,19 @@ BOOL wlf_handle_pointer_axis(freerdp* instance, const UwacPointerAxisEvent* ev)
return FALSE;
}
step = (uint32_t)abs(direction);
if (step > WheelRotationMask)
step = WheelRotationMask;
/* Wheel rotation steps:
*
* positive: 0 ... 0xFF -> slow ... fast
* negative: 0 ... 0xFF -> fast ... slow
*/
step = abs(direction);
if (step > 0xFF)
step = 0xFF;
/* Negative rotation, so count down steps from top */
if (flags & PTR_FLAGS_WHEEL_NEGATIVE)
step = 0xFF - step;
flags |= step;
return freerdp_input_send_mouse_event(input, flags, (UINT16)x, (UINT16)y);