Skip to content

Commit

Permalink
Fix formatting and reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
copygirl authored and VPeruS committed Jan 29, 2018
1 parent ea3f7bf commit 30798cd
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 19 deletions.
27 changes: 15 additions & 12 deletions src/OpenTK/Platform/Linux/LinuxNativeWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -374,18 +374,6 @@ public override Point PointToScreen(Point point)
return new Point(point.X + client.X, point.Y + client.Y);
}

public override bool CursorGrabbed
{
get { return true; }
set
{
if (value == false)
{
throw new NotImplementedException();
}
}
}

protected override void Dispose(bool disposing)
{
if (disposing)
Expand Down Expand Up @@ -512,6 +500,21 @@ public override Size ClientSize
}
}

public override bool CursorGrabbed
{
get
{
return true;
}
set
{
if (value == false)
{
throw new NotImplementedException();
}
}
}

public override bool CursorVisible
{
get
Expand Down
7 changes: 5 additions & 2 deletions src/OpenTK/Platform/MacOS/CocoaNativeWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ static CocoaNativeWindow()
private IntPtr current_icon_handle;
private bool disposed = false;
private bool exists;
private bool cursorGrabbed = false;
private bool cursorVisible = true;
private Icon icon;
private WindowBorder windowBorder = WindowBorder.Resizable;
Expand All @@ -155,7 +156,6 @@ static CocoaNativeWindow()
private bool shouldClose;
private int suppressResize;
private MouseCursor selectedCursor = MouseCursor.Default; // user-selected cursor
private bool cursorGrabbed = false;

public CocoaNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device)
{
Expand Down Expand Up @@ -1260,7 +1260,10 @@ private void InvalidateCursorRects()

public override bool CursorGrabbed
{
get { return cursorGrabbed; }
get
{
return cursorGrabbed;
}
set
{
SetCursorGrab(value);
Expand Down
2 changes: 1 addition & 1 deletion src/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ internal class Sdl2NativeWindow : NativeWindowBase
private uint window_id;
private bool is_visible;
private bool is_focused;
private bool is_cursor_visible = true;
private bool is_cursor_grabbed = false;
private bool is_cursor_visible = true;
private bool exists;
private bool must_destroy;
private bool disposed;
Expand Down
7 changes: 5 additions & 2 deletions src/OpenTK/Platform/Windows/WinGLNative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ private Rectangle

private MouseCursor cursor = MouseCursor.Default;
private IntPtr cursor_handle = Functions.LoadCursor(CursorName.Arrow);
private int cursor_visible_count = 0;
private bool cursor_grabbed = false;
private int cursor_visible_count = 0;

private static readonly object SyncRoot = new object();

Expand Down Expand Up @@ -1259,7 +1259,10 @@ public override MouseCursor Cursor

public override bool CursorGrabbed
{
get { return cursor_grabbed; }
get
{
return cursor_grabbed;
}
set
{
cursor_grabbed = value;
Expand Down
7 changes: 5 additions & 2 deletions src/OpenTK/Platform/X11/X11GLNative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ internal sealed class X11GLNative : NativeWindowBase

private MouseCursor cursor = MouseCursor.Default;
private IntPtr cursorHandle;
private bool cursor_visible = true;
private bool cursor_grabbed = false;
private bool cursor_visible = true;

// Keyboard input
private readonly byte[] ascii = new byte[16];
Expand Down Expand Up @@ -1701,7 +1701,10 @@ public override bool CursorVisible

public override bool CursorGrabbed
{
get { return cursor_grabbed; }
get
{
return cursor_grabbed;
}
set
{
using (new XLock(window.Display))
Expand Down

0 comments on commit 30798cd

Please sign in to comment.