From 673c922b72b8f185b6bd05bed243c78872560642 Mon Sep 17 00:00:00 2001 From: copygirl Date: Tue, 2 Jan 2018 01:30:35 +0100 Subject: [PATCH] Move cursor visible check into implementations --- src/OpenTK/NativeWindow.cs | 6 +----- src/OpenTK/Platform/Linux/LinuxNativeWindow.cs | 1 + src/OpenTK/Platform/MacOS/CocoaNativeWindow.cs | 1 + src/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/OpenTK/NativeWindow.cs b/src/OpenTK/NativeWindow.cs index 3ef08d01..249db50f 100644 --- a/src/OpenTK/NativeWindow.cs +++ b/src/OpenTK/NativeWindow.cs @@ -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; } } /// diff --git a/src/OpenTK/Platform/Linux/LinuxNativeWindow.cs b/src/OpenTK/Platform/Linux/LinuxNativeWindow.cs index b9c88608..36304bc2 100644 --- a/src/OpenTK/Platform/Linux/LinuxNativeWindow.cs +++ b/src/OpenTK/Platform/Linux/LinuxNativeWindow.cs @@ -508,6 +508,7 @@ namespace OpenTK.Platform.Linux } set { + if (value == is_cursor_visible) return; if (value && !is_cursor_visible) { SetCursor(cursor_current); diff --git a/src/OpenTK/Platform/MacOS/CocoaNativeWindow.cs b/src/OpenTK/Platform/MacOS/CocoaNativeWindow.cs index 5ec5fe93..a0d52817 100644 --- a/src/OpenTK/Platform/MacOS/CocoaNativeWindow.cs +++ b/src/OpenTK/Platform/MacOS/CocoaNativeWindow.cs @@ -1239,6 +1239,7 @@ namespace OpenTK.Platform.MacOS get { return cursorVisible; } set { + if (value == cursorVisible) return; if (value && !cursorVisible) { SetCursorVisible(true); diff --git a/src/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs b/src/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs index a04effce..d4a7b224 100644 --- a/src/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs +++ b/src/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs @@ -933,6 +933,7 @@ namespace OpenTK.Platform.SDL2 } set { + if (value == is_cursor_visible) return; lock (sync) { if (Exists)