From 53df5422b8432216ca5f21831f3e53e484b69426 Mon Sep 17 00:00:00 2001 From: Doug Binks Date: Tue, 24 Jun 2014 17:32:33 +0200 Subject: [PATCH 1/5] Added style WS_VISIBLE to fix mode change issues with focus. --- src/win32_window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win32_window.c b/src/win32_window.c index 6d39c3edf..c013e409c 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -39,7 +39,7 @@ // static getWindowStyle(const _GLFWwndconfig* wndconfig) { - DWORD style = WS_CLIPSIBLINGS | WS_CLIPCHILDREN; + DWORD style = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE; if (wndconfig->decorated && wndconfig->monitor == NULL) { From e4c919a6dffd917a3bd2a05d5420eae7ea98d18b Mon Sep 17 00:00:00 2001 From: Doug Binks Date: Tue, 24 Jun 2014 20:17:09 +0200 Subject: [PATCH 2/5] WS_VISIBLE only set if window needs to be visible. --- src/win32_window.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/win32_window.c b/src/win32_window.c index c013e409c..232877c1e 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -39,7 +39,12 @@ // static getWindowStyle(const _GLFWwndconfig* wndconfig) { - DWORD style = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE; + DWORD style = WS_CLIPSIBLINGS | WS_CLIPCHILDREN; + + if (wndconfig->visible) + { + style |= WS_VISIBLE; + } if (wndconfig->decorated && wndconfig->monitor == NULL) { @@ -1209,6 +1214,7 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, wndconfig.resizable = window->resizable; wndconfig.decorated = window->decorated; wndconfig.monitor = monitor; + wndconfig.visible = window->visible || monitor; window->win32.dwStyle = getWindowStyle(&wndconfig); window->win32.dwExStyle = getWindowExStyle(&wndconfig); From 2c5a3816753dedbb92bc45772c5682587bbda4b5 Mon Sep 17 00:00:00 2001 From: Doug Binks Date: Tue, 24 Jun 2014 22:51:32 +0200 Subject: [PATCH 3/5] Moved WS_VISIBLE modifier to SetWindowLongPtr in _glfwPlatformSetWindowMonitor --- src/win32_window.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/win32_window.c b/src/win32_window.c index 232877c1e..d512b35ad 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -41,11 +41,6 @@ static getWindowStyle(const _GLFWwndconfig* wndconfig) { DWORD style = WS_CLIPSIBLINGS | WS_CLIPCHILDREN; - if (wndconfig->visible) - { - style |= WS_VISIBLE; - } - if (wndconfig->decorated && wndconfig->monitor == NULL) { style |= WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX; @@ -1214,13 +1209,14 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, wndconfig.resizable = window->resizable; wndconfig.decorated = window->decorated; wndconfig.monitor = monitor; - wndconfig.visible = window->visible || monitor; window->win32.dwStyle = getWindowStyle(&wndconfig); window->win32.dwExStyle = getWindowExStyle(&wndconfig); + DWORD styleMod = (window->visible || monitor) ? WS_VISIBLE : 0; + SetWindowLongPtr(window->win32.handle, - GWL_STYLE, window->win32.dwStyle); + GWL_STYLE, window->win32.dwStyle | WS_VISIBLE); SetWindowLongPtr(window->win32.handle, GWL_EXSTYLE, window->win32.dwExStyle); } From 08b91c55163087dd3793088fbdb55092264331a4 Mon Sep 17 00:00:00 2001 From: Doug Binks Date: Tue, 24 Jun 2014 23:07:00 +0200 Subject: [PATCH 4/5] FIxed issue in previous commit. --- src/win32_window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win32_window.c b/src/win32_window.c index d512b35ad..29743eae4 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1216,7 +1216,7 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, DWORD styleMod = (window->visible || monitor) ? WS_VISIBLE : 0; SetWindowLongPtr(window->win32.handle, - GWL_STYLE, window->win32.dwStyle | WS_VISIBLE); + GWL_STYLE, window->win32.dwStyle | styleMod); SetWindowLongPtr(window->win32.handle, GWL_EXSTYLE, window->win32.dwExStyle); } From 716c2d97a08cfc6d7fa229317f69846d033359a0 Mon Sep 17 00:00:00 2001 From: Doug Binks Date: Wed, 25 Jun 2014 10:06:53 +0200 Subject: [PATCH 5/5] Removed styleMod. --- src/win32_window.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/win32_window.c b/src/win32_window.c index 29743eae4..a48fcb3b0 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1213,10 +1213,8 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, window->win32.dwStyle = getWindowStyle(&wndconfig); window->win32.dwExStyle = getWindowExStyle(&wndconfig); - DWORD styleMod = (window->visible || monitor) ? WS_VISIBLE : 0; - SetWindowLongPtr(window->win32.handle, - GWL_STYLE, window->win32.dwStyle | styleMod); + GWL_STYLE, window->win32.dwStyle | WS_VISIBLE); SetWindowLongPtr(window->win32.handle, GWL_EXSTYLE, window->win32.dwExStyle); }