Fixed window parameter refresh.
diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 74f187b..2f6b851 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m
@@ -1041,7 +1041,7 @@ // Write back window parameters into GLFW window structure //======================================================================== -void _glfwPlatformRefreshWindowParams(void) +void _glfwPlatformRefreshWindowParams(_GLFWwindow* window) { }
diff --git a/src/internal.h b/src/internal.h index 99d74b8..81eb26c 100644 --- a/src/internal.h +++ b/src/internal.h
@@ -326,7 +326,7 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window); void _glfwPlatformSwapBuffers(void); void _glfwPlatformSwapInterval(int interval); -void _glfwPlatformRefreshWindowParams(void); +void _glfwPlatformRefreshWindowParams(_GLFWwindow* window); int _glfwPlatformExtensionSupported(const char* extension); GLFWglproc _glfwPlatformGetProcAddress(const char* procname); void _glfwPlatformCopyContext(_GLFWwindow* src, _GLFWwindow* dst, unsigned long mask);
diff --git a/src/win32_window.c b/src/win32_window.c index fff50ea..aced151 100755 --- a/src/win32_window.c +++ b/src/win32_window.c
@@ -1198,10 +1198,9 @@ // Write back window parameters into GLFW window structure //======================================================================== -void _glfwPlatformRefreshWindowParams(void) +void _glfwPlatformRefreshWindowParams(_GLFWwindow* window) { DEVMODE dm; - _GLFWwindow* window = _glfwLibrary.currentWindow; ZeroMemory(&dm, sizeof(DEVMODE)); dm.dmSize = sizeof(DEVMODE);
diff --git a/src/window.c b/src/window.c index 2e77fa1..2723732 100644 --- a/src/window.c +++ b/src/window.c
@@ -318,17 +318,18 @@ return GL_FALSE; } - // Cache the actual (as opposed to desired) window parameters - _glfwPlatformRefreshWindowParams(); + // Cache the actual (as opposed to requested) window parameters + _glfwPlatformRefreshWindowParams(window); + // Cache the actual (as opposed to requested) context parameters glfwMakeContextCurrent(window); - if (!_glfwRefreshContextParams()) { glfwCloseWindow(window); return GL_FALSE; } + // Verify the context against the requested parameters if (!_glfwIsValidContext(&wndconfig)) { glfwCloseWindow(window); @@ -573,7 +574,7 @@ { // Refresh window parameters (may have changed due to changed video // modes) - _glfwPlatformRefreshWindowParams(); + _glfwPlatformRefreshWindowParams(window); } } @@ -665,7 +666,7 @@ _glfwPlatformRestoreWindow(window); if (window->mode == GLFW_FULLSCREEN) - _glfwPlatformRefreshWindowParams(); + _glfwPlatformRefreshWindowParams(window); }
diff --git a/src/x11_window.c b/src/x11_window.c index e5c548d..656c373 100644 --- a/src/x11_window.c +++ b/src/x11_window.c
@@ -1137,10 +1137,8 @@ // Read back framebuffer parameters from the context //======================================================================== -void _glfwPlatformRefreshWindowParams(void) +void _glfwPlatformRefreshWindowParams(_GLFWwindow* window) { - _GLFWwindow* window = _glfwLibrary.currentWindow; - // Retrieve refresh rate if possible if (_glfwLibrary.X11.RandR.available) {