Move cursor visible check into implementations
authorcopygirl <copygirl@mcft.net>
Tue, 2 Jan 2018 00:30:35 +0000 (01:30 +0100)
committercopygirl <copygirl@mcft.net>
Fri, 5 Jan 2018 17:43:19 +0000 (18:43 +0100)
src/OpenTK/NativeWindow.cs
src/OpenTK/Platform/Linux/LinuxNativeWindow.cs
src/OpenTK/Platform/MacOS/CocoaNativeWindow.cs
src/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs

index 3ef08d0..249db50 100644 (file)
@@ -476,11 +476,7 @@ namespace OpenTK
         public bool CursorVisible
         {
             get { return implementation.CursorVisible; }
-            set
-            {
-                if (value == implementation.CursorVisible) return;
-                implementation.CursorVisible = value;
-            }
+            set { implementation.CursorVisible = value; }
         }
 
         /// <summary>
index b9c8860..36304bc 100644 (file)
@@ -508,6 +508,7 @@ namespace OpenTK.Platform.Linux
             }
             set
             {
+                if (value == is_cursor_visible) return;
                 if (value && !is_cursor_visible)
                 {
                     SetCursor(cursor_current);
index 5ec5fe9..a0d5281 100644 (file)
@@ -1239,6 +1239,7 @@ namespace OpenTK.Platform.MacOS
             get { return cursorVisible; }
             set
             {
+                if (value == cursorVisible) return;
                 if (value && !cursorVisible)
                 {
                     SetCursorVisible(true);
index a04effc..d4a7b22 100644 (file)
@@ -933,6 +933,7 @@ namespace OpenTK.Platform.SDL2
             }
             set
             {
+                if (value == is_cursor_visible) return;
                 lock (sync)
                 {
                     if (Exists)