Move all cursor positioning to platform code

Due to Wayland, shared code cannot rely on cursor positioning being
supported by the underlying platform.

This implicitly fixes #617 as it moves cursor centering into
_glfwPlatformSetCursorMode, thus separating it from the stale value of
_glfw.cursorWindow.

Fixes #617.
This commit is contained in:
Camilla Berglund
2016-05-25 14:06:02 +02:00
parent 0e846883bf
commit 797ee8d8e3
12 changed files with 205 additions and 182 deletions
+3 -1
View File
@@ -118,7 +118,7 @@ typedef struct _GLFWwindowX11
int xpos, ypos;
// The last received cursor position, regardless of source
double lastCursorPosX, lastCursorPosY;
int lastCursorPosX, lastCursorPosY;
// The last position the cursor was warped to by GLFW
int warpCursorPosX, warpCursorPosY;
@@ -155,6 +155,8 @@ typedef struct _GLFWlibraryX11
short int publicKeys[256];
// GLFW key to X11 keycode LUT
short int nativeKeys[GLFW_KEY_LAST + 1];
// Where to place the cursor when re-enabled
double restoreCursorPosX, restoreCursorPosY;
// Window manager atoms
Atom WM_PROTOCOLS;