From 637a8bee66579eccc79e99bb57a99707f92afcca Mon Sep 17 00:00:00 2001 From: thefiddler <stapostol@gmail.com> Date: Tue, 6 May 2014 09:01:23 +0200 Subject: [PATCH] [Platform] More selective mouse events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We should not raise mouse events when the cursor state hasn’t changed. --- Source/OpenTK/Platform/NativeWindowBase.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/OpenTK/Platform/NativeWindowBase.cs b/Source/OpenTK/Platform/NativeWindowBase.cs index 7a268ef3..5d19b7be 100644 --- a/Source/OpenTK/Platform/NativeWindowBase.cs +++ b/Source/OpenTK/Platform/NativeWindowBase.cs @@ -260,6 +260,7 @@ namespace OpenTK.Platform if (e.XDelta == 0 && e.YDelta == 0) { Debug.WriteLine("OnMouseMove called without moving the mouse"); + return; } PreviousMouseState = MouseState; @@ -277,6 +278,7 @@ namespace OpenTK.Platform if (dx == 0 && dy == 0) { Debug.WriteLine("OnMouseWheel called without moving the mouse wheel."); + return; } PreviousMouseState = MouseState;