X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/06efac1f8d6acde1610ba23a7b315ade8ed46679..7abde9c65a3c2f25ab4099727d4287add6820428:/src/msw/display.cpp diff --git a/src/msw/display.cpp b/src/msw/display.cpp index 28cc8067b8..10012b320f 100644 --- a/src/msw/display.cpp +++ b/src/msw/display.cpp @@ -297,7 +297,7 @@ static void InitDisplays() gs_displays = new wxDisplayInfoArray(); - if ( gs_useDirectX && !DoInitDirectX() ) + if ( !gs_useDirectX || !DoInitDirectX() ) { // either we were told not to try to use DirectX or fall back to std // functions if DirectX method failed @@ -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: