Move cursor visible check into implementations

This commit is contained in:
copygirl 2018-01-02 01:30:35 +01:00
parent fe65c87d81
commit 673c922b72
4 changed files with 4 additions and 5 deletions

View file

@ -476,11 +476,7 @@ namespace OpenTK
public bool CursorVisible public bool CursorVisible
{ {
get { return implementation.CursorVisible; } get { return implementation.CursorVisible; }
set set { implementation.CursorVisible = value; }
{
if (value == implementation.CursorVisible) return;
implementation.CursorVisible = value;
}
} }
/// <summary> /// <summary>

View file

@ -508,6 +508,7 @@ namespace OpenTK.Platform.Linux
} }
set set
{ {
if (value == is_cursor_visible) return;
if (value && !is_cursor_visible) if (value && !is_cursor_visible)
{ {
SetCursor(cursor_current); SetCursor(cursor_current);

View file

@ -1239,6 +1239,7 @@ namespace OpenTK.Platform.MacOS
get { return cursorVisible; } get { return cursorVisible; }
set set
{ {
if (value == cursorVisible) return;
if (value && !cursorVisible) if (value && !cursorVisible)
{ {
SetCursorVisible(true); SetCursorVisible(true);

View file

@ -933,6 +933,7 @@ namespace OpenTK.Platform.SDL2
} }
set set
{ {
if (value == is_cursor_visible) return;
lock (sync) lock (sync)
{ {
if (Exists) if (Exists)