1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 10:48:51 -05:00

Renamed cursor window library struct member.

Since _glfwPlatformWindowFocused it has a more limited role.
This commit is contained in:
Camilla Berglund 2015-06-17 11:59:39 +02:00
parent 226f85efcb
commit cc4c232956
6 changed files with 19 additions and 19 deletions

View File

@ -203,7 +203,7 @@ static int translateKey(unsigned int key)
{ {
[window->nsgl.context update]; [window->nsgl.context update];
if (_glfw.focusedWindow == window && if (_glfw.cursorWindow == window &&
window->cursorMode == GLFW_CURSOR_DISABLED) window->cursorMode == GLFW_CURSOR_DISABLED)
{ {
centerCursor(window); centerCursor(window);
@ -221,7 +221,7 @@ static int translateKey(unsigned int key)
{ {
[window->nsgl.context update]; [window->nsgl.context update];
if (_glfw.focusedWindow == window && if (_glfw.cursorWindow == window &&
window->cursorMode == GLFW_CURSOR_DISABLED) window->cursorMode == GLFW_CURSOR_DISABLED)
{ {
centerCursor(window); centerCursor(window);
@ -247,7 +247,7 @@ static int translateKey(unsigned int key)
if (window->monitor && window->autoIconify) if (window->monitor && window->autoIconify)
enterFullscreenMode(window); enterFullscreenMode(window);
if (_glfw.focusedWindow == window && if (_glfw.cursorWindow == window &&
window->cursorMode == GLFW_CURSOR_DISABLED) window->cursorMode == GLFW_CURSOR_DISABLED)
{ {
centerCursor(window); centerCursor(window);

View File

@ -55,7 +55,7 @@ static void setCursorMode(_GLFWwindow* window, int newMode)
window->cursorMode = newMode; window->cursorMode = newMode;
if (_glfw.focusedWindow == window) if (_glfw.cursorWindow == window)
{ {
if (oldMode == GLFW_CURSOR_DISABLED) if (oldMode == GLFW_CURSOR_DISABLED)
{ {
@ -343,7 +343,7 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow* handle, double xpos, double ypos)
_GLFW_REQUIRE_INIT(); _GLFW_REQUIRE_INIT();
if (_glfw.focusedWindow != window) if (_glfw.cursorWindow != window)
return; return;
if (window->cursorMode == GLFW_CURSOR_DISABLED) if (window->cursorMode == GLFW_CURSOR_DISABLED)

View File

@ -334,7 +334,7 @@ struct _GLFWlibrary
_GLFWcursor* cursorListHead; _GLFWcursor* cursorListHead;
_GLFWwindow* windowListHead; _GLFWwindow* windowListHead;
_GLFWwindow* focusedWindow; _GLFWwindow* cursorWindow;
_GLFWmonitor** monitors; _GLFWmonitor** monitors;
int monitorCount; int monitorCount;

View File

@ -462,7 +462,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
if (window->cursorMode == GLFW_CURSOR_DISABLED) if (window->cursorMode == GLFW_CURSOR_DISABLED)
{ {
if (_glfw.focusedWindow != window) if (_glfw.cursorWindow != window)
break; break;
_glfwInputCursorMotion(window, _glfwInputCursorMotion(window,
@ -514,7 +514,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
case WM_SIZE: case WM_SIZE:
{ {
if (_glfw.focusedWindow == window) if (_glfw.cursorWindow == window)
{ {
if (window->cursorMode == GLFW_CURSOR_DISABLED) if (window->cursorMode == GLFW_CURSOR_DISABLED)
updateClipRect(window); updateClipRect(window);
@ -539,7 +539,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
case WM_MOVE: case WM_MOVE:
{ {
if (_glfw.focusedWindow == window) if (_glfw.cursorWindow == window)
{ {
if (window->cursorMode == GLFW_CURSOR_DISABLED) if (window->cursorMode == GLFW_CURSOR_DISABLED)
updateClipRect(window); updateClipRect(window);
@ -566,7 +566,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
case WM_SETCURSOR: case WM_SETCURSOR:
{ {
if (_glfw.focusedWindow == window && LOWORD(lParam) == HTCLIENT) if (_glfw.cursorWindow == window && LOWORD(lParam) == HTCLIENT)
{ {
if (window->cursorMode == GLFW_CURSOR_HIDDEN || if (window->cursorMode == GLFW_CURSOR_HIDDEN ||
window->cursorMode == GLFW_CURSOR_DISABLED) window->cursorMode == GLFW_CURSOR_DISABLED)
@ -1015,7 +1015,7 @@ void _glfwPlatformPollEvents(void)
} }
} }
window = _glfw.focusedWindow; window = _glfw.cursorWindow;
if (window) if (window)
{ {
// LSHIFT/RSHIFT fixup (keys tend to "stick" without this fix) // LSHIFT/RSHIFT fixup (keys tend to "stick" without this fix)
@ -1194,7 +1194,7 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
// the following condition is not met. That way it should be safe to destroy the // the following condition is not met. That way it should be safe to destroy the
// cursor after calling glfwSetCursor(window, NULL) on all windows using the cursor. // cursor after calling glfwSetCursor(window, NULL) on all windows using the cursor.
if (_glfw.focusedWindow == window && if (_glfw.cursorWindow == window &&
window->cursorMode == GLFW_CURSOR_NORMAL && window->cursorMode == GLFW_CURSOR_NORMAL &&
window->win32.cursorInside) window->win32.cursorInside)
{ {

View File

@ -40,7 +40,7 @@ void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused)
{ {
if (focused) if (focused)
{ {
_glfw.focusedWindow = window; _glfw.cursorWindow = window;
if (window->callbacks.focus) if (window->callbacks.focus)
window->callbacks.focus((GLFWwindow*) window, focused); window->callbacks.focus((GLFWwindow*) window, focused);
@ -49,7 +49,7 @@ void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused)
{ {
int i; int i;
_glfw.focusedWindow = NULL; _glfw.cursorWindow = NULL;
if (window->callbacks.focus) if (window->callbacks.focus)
window->callbacks.focus((GLFWwindow*) window, focused); window->callbacks.focus((GLFWwindow*) window, focused);
@ -385,8 +385,8 @@ GLFWAPI void glfwDestroyWindow(GLFWwindow* handle)
_glfwPlatformMakeContextCurrent(NULL); _glfwPlatformMakeContextCurrent(NULL);
// Clear the focused window pointer if this is the focused window // Clear the focused window pointer if this is the focused window
if (_glfw.focusedWindow == window) if (_glfw.cursorWindow == window)
_glfw.focusedWindow = NULL; _glfw.cursorWindow = NULL;
_glfwPlatformDestroyWindow(window); _glfwPlatformDestroyWindow(window);

View File

@ -1044,7 +1044,7 @@ static void processEvent(XEvent *event)
if (window->cursorMode == GLFW_CURSOR_DISABLED) if (window->cursorMode == GLFW_CURSOR_DISABLED)
{ {
if (_glfw.focusedWindow != window) if (_glfw.cursorWindow != window)
return; return;
_glfwInputCursorMotion(window, _glfwInputCursorMotion(window,
@ -1328,7 +1328,7 @@ static void processEvent(XEvent *event)
if (window->cursorMode == GLFW_CURSOR_DISABLED) if (window->cursorMode == GLFW_CURSOR_DISABLED)
{ {
if (_glfw.focusedWindow != window) if (_glfw.cursorWindow != window)
return; return;
x = data->event_x - window->x11.cursorPosX; x = data->event_x - window->x11.cursorPosX;
@ -1725,7 +1725,7 @@ void _glfwPlatformPollEvents(void)
processEvent(&event); processEvent(&event);
} }
_GLFWwindow* window = _glfw.focusedWindow; _GLFWwindow* window = _glfw.cursorWindow;
if (window && window->cursorMode == GLFW_CURSOR_DISABLED) if (window && window->cursorMode == GLFW_CURSOR_DISABLED)
{ {
int width, height; int width, height;