X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/82eba82658182db222b56108a2f52e59e3f0b3d1..7abde9c65a3c2f25ab4099727d4287add6820428:/src/msw/display.cpp?ds=inline diff --git a/src/msw/display.cpp b/src/msw/display.cpp index 1fd815e37c..10012b320f 100644 --- a/src/msw/display.cpp +++ b/src/msw/display.cpp @@ -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: