X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d66d050088ee2012542a2d2607b5329ff5f3a491..e6ba38871f6cc5c02391c04e37e481d0428cef3f:/src/msw/window.cpp?ds=sidebyside diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 7a81ded775..5ddf3d7a8c 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -4262,13 +4262,14 @@ bool wxWindowMSW::HandlePower(WXWPARAM WXUNUSED_IN_WINCE(wParam), bool wxWindowMSW::IsDoubleBuffered() const { - const wxWindowMSW *wnd = this; - do + for ( const wxWindowMSW *win = this; win; win = win->GetParent() ) { - if ( wxHasWindowExStyle(wnd, WS_EX_COMPOSITED) ) + if ( wxHasWindowExStyle(win, WS_EX_COMPOSITED) ) return true; - wnd = wnd->GetParent(); - } while ( wnd && !wnd->IsTopLevel() ); + + if ( win->IsTopLevel() ) + break; + } return false; }