Index: /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c	(revision 43265)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c	(revision 43266)
@@ -841,4 +841,24 @@
     }
 
+    window->visible = showIt;
+
+    if (!showIt)
+    {
+        renderspu_SystemShowWindow( window, 0 );
+        if (window->height <= 0 || window->width <= 0)
+        {
+            renderspu_SystemWindowSize(window,
+                    window->width > 0 ? window->width : 4,
+                    window->height > 0 ? window->height : 4);
+        }
+    }
+    else
+    {
+        crDebug( "Render SPU: Showing the window" );
+        crDebug("renderspu_SystemCreateWindow: showwindow: %x", window->hWnd);
+    }
+
+    CRASSERT(!window->visible == !showIt);
+
     /* Intel drivers require a window to be visible for proper 3D rendering,
      * so set it visible and handle the visibility with visible regions (see below) */
@@ -866,22 +886,4 @@
         crError( "Render SPU: Couldn't set up the device context!  Yikes!" );
         return GL_FALSE;
-    }
-
-    window->visible = showIt;
-
-    if (!showIt)
-    {
-        renderspu_SystemShowWindow( window, 0 );
-        if (window->height <= 0 || window->width <= 0)
-        {
-            renderspu_SystemWindowSize(window,
-                    window->width > 0 ? window->width : 4,
-                    window->height > 0 ? window->height : 4);
-        }
-    }
-    else
-    {
-        crDebug( "Render SPU: Showing the window" );
-        crDebug("renderspu_SystemCreateWindow: showwindow: %x", window->hWnd);
     }
 
@@ -1104,4 +1106,24 @@
     }
 
+    window->visible = 1;
+
+    if (!showIt)
+    {
+        renderspu_SystemShowWindow( window, 0 );
+        if (window->height <= 0 || window->width <= 0)
+        {
+            renderspu_SystemWindowSize(window,
+                    window->width > 0 ? window->width : 4,
+                    window->height > 0 ? window->height : 4);
+        }
+    }
+    else
+    {
+        crDebug( "Render SPU: Showing the window" );
+        crDebug("renderspu_SystemCreateWindow: showwindow: %x", window->hWnd);
+    }
+
+    CRASSERT(!window->visible == !showIt);
+
     /* Intel drivers require a window to be visible for proper 3D rendering,
      * so set it visible and handle the visibility with visible regions (see below) */
@@ -1129,22 +1151,4 @@
         crError( "Render SPU: Couldn't set up the device context!  Yikes!" );
         return GL_FALSE;
-    }
-
-    window->visible = showIt;
-
-    if (!showIt)
-    {
-        renderspu_SystemShowWindow( window, 0 );
-        if (window->height <= 0 || window->width <= 0)
-        {
-            renderspu_SystemWindowSize(window,
-                    window->width > 0 ? window->width : 4,
-                    window->height > 0 ? window->height : 4);
-        }
-    }
-    else
-    {
-        crDebug( "Render SPU: Showing the window" );
-        crDebug("renderspu_SystemCreateWindow: showwindow: %x", window->hWnd);
     }
 
