diff --git a/Source/OpenTK/Platform/X11/XI2MouseKeyboard.cs b/Source/OpenTK/Platform/X11/XI2MouseKeyboard.cs index 1ef31796..0df840ce 100644 --- a/Source/OpenTK/Platform/X11/XI2MouseKeyboard.cs +++ b/Source/OpenTK/Platform/X11/XI2MouseKeyboard.cs @@ -544,7 +544,11 @@ namespace OpenTK.Platform.X11 d.State.X += (int)Math.Round(x); d.State.Y += (int)Math.Round(y); - d.State.SetScrollRelative((float)h, (float)v); + + // Note: OpenTK follows the windows scrolling convention where + // (+h, +v) = (right, up). XI2 uses (+h, +v) = (right, down) + // instead, so we need to flip the vertical offset. + d.State.SetScrollRelative((float)h, (float)(-v)); } unsafe static double ReadRawValue(ref XIRawEvent raw, int bit)