]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/display.cpp
Attempt to make wxWindows play better with XP themes
[wxWidgets.git] / src / msw / display.cpp
index 1fd815e37c24d13df5bc282f1aaf16537d2fbde8..10012b320f6b21406889f0c4347bc66a68de6ec6 100644 (file)
@@ -729,6 +729,18 @@ bool wxDisplay::DoChangeModeWindows(const wxVideoMode& mode)
     {
         case DISP_CHANGE_SUCCESSFUL:
             // ok
+            {
+                // If we have a top-level, full-screen frame, emulate
+                // the DirectX behavior and resize it.  This makes this
+                // API quite a bit easier to use.
+                wxWindow *winTop = wxTheApp->GetTopWindow();
+                wxFrame *frameTop = wxDynamicCast(winTop, wxFrame);
+                if (frameTop && frameTop->IsFullScreen())
+                {
+                    wxVideoMode current = GetCurrentMode();
+                    frameTop->SetClientSize(current.w, current.h);
+                }
+            }
             return true;
 
         case DISP_CHANGE_BADMODE: