[X11] Fixed GetCursorState() after SetPosition()

The new position is now immediately reflected in GetCursorPos().
This commit is contained in:
thefiddler 2014-05-13 23:50:39 +02:00
parent 452d61bc60
commit dd16142a3a

View file

@ -139,6 +139,7 @@ namespace OpenTK.Platform.X11
XIEventMasks.RawButtonPressMask |
XIEventMasks.RawButtonReleaseMask |
XIEventMasks.RawMotionMask |
XIEventMasks.MotionMask |
XIEventMasks.DeviceChangedMask |
(XIEventMasks)(1 << (int)ExitEvent)))
{
@ -313,6 +314,8 @@ namespace OpenTK.Platform.X11
{
Functions.XWarpPointer(API.DefaultDisplay,
IntPtr.Zero, window.RootWindow, 0, 0, 0, 0, (int)x, (int)y);
Interlocked.Exchange(ref cursor_x, (long)x);
Interlocked.Exchange(ref cursor_y, (long)y);
// Mark the expected warp-event so it can be ignored.
if (mouse_warp_event == null)
@ -352,6 +355,10 @@ namespace OpenTK.Platform.X11
{
switch ((XIEventType)cookie.evtype)
{
case XIEventType.Motion:
// Nothing to do
break;
case XIEventType.RawMotion:
case XIEventType.RawButtonPress:
case XIEventType.RawButtonRelease: