From 1bf33a7402cb14bdeaffb555b0e2d41b275429c7 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 3 Nov 2015 15:16:00 +0100 Subject: [PATCH] Clarify WNDPROC window pointer handling --- src/win32_window.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/win32_window.c b/src/win32_window.c index 2b34a1ce..29511d83 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -255,16 +255,19 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { _GLFWwindow* window = (_GLFWwindow*) GetWindowLongPtrW(hWnd, 0); - - switch (uMsg) + if (!window) { - case WM_NCCREATE: + if (uMsg == WM_NCCREATE) { CREATESTRUCTW* cs = (CREATESTRUCTW*) lParam; SetWindowLongPtrW(hWnd, 0, (LONG_PTR) cs->lpCreateParams); - break; } + return DefWindowProcW(hWnd, uMsg, wParam, lParam); + } + + switch (uMsg) + { case WM_SETFOCUS: { if (window->cursorMode == GLFW_CURSOR_DISABLED) @@ -529,9 +532,6 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, int xoff, yoff; MINMAXINFO* mmi = (MINMAXINFO*) lParam; - if (!window) - break; - getFullWindowSize(getWindowStyle(window), getWindowExStyle(window), 0, 0, &xoff, &yoff);