From 1cd2b8d0766832aebbe91b35bb1ec2dc70188a6d Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sat, 7 Nov 2009 10:44:31 +0000 Subject: [PATCH] Use SHOW command instead of SHOWNORMAL when making a window visible, since SHOWNORMAL will un-maximize a fullscreen or maximized window. Do not force an invisible window to become visible when modifying its state or borders. --- Source/OpenTK/Platform/Windows/WinGLNative.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/OpenTK/Platform/Windows/WinGLNative.cs b/Source/OpenTK/Platform/Windows/WinGLNative.cs index 737d5c9f..cf622365 100644 --- a/Source/OpenTK/Platform/Windows/WinGLNative.cs +++ b/Source/OpenTK/Platform/Windows/WinGLNative.cs @@ -810,7 +810,7 @@ namespace OpenTK.Platform.Windows { if (value) { - Functions.ShowWindow(window.WindowHandle, ShowWindowCommand.SHOWNORMAL); + Functions.ShowWindow(window.WindowHandle, ShowWindowCommand.SHOW); } else if (!value) { @@ -989,7 +989,11 @@ namespace OpenTK.Platform.Windows SetWindowPosFlags.NOMOVE | SetWindowPosFlags.NOZORDER | SetWindowPosFlags.FRAMECHANGED); - Visible = true; + // Force window to redraw update its borders, but only if it's + // already visible (invisible windows will change borders when + // they become visible, so no need to make them visiable prematurely). + if (Visible) + Visible = true; WindowState = state;