From 17dd5538ef281b552875e9a7c5c49cf87d8b1ad9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 7 Sep 2006 11:14:52 +0000 Subject: [PATCH] verify that we're not painting on hidden window (which is not implemented) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/dfb/dcclient.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/dfb/dcclient.cpp b/src/dfb/dcclient.cpp index 7f02fbedde..36a57c8330 100644 --- a/src/dfb/dcclient.cpp +++ b/src/dfb/dcclient.cpp @@ -51,6 +51,23 @@ void wxWindowDC::InitForWin(wxWindow *win) { wxCHECK_RET( win, _T("invalid window") ); + // FIXME: this should be made to work: we need to detect that the window + // is not visible and in that case, a) ignore any drawing actions + // and b) provide dummy surface that can still be used to get + // information (e.g. text extents): + wxWindow *w = win; + for ( wxWindow *w = win; w; w = w->GetParent() ) + { + // painting on hidden TLW when non-TLW windows are shown is OK, + // DirectFB manages that: + if ( w->IsTopLevel() ) + break; + + wxASSERT_MSG( w->IsShown(), + _T("painting on hidden window not implemented yet") ); + } + + SetFont(win->GetFont()); } @@ -87,6 +104,9 @@ wxClientDC::~wxClientDC() { // flip to surface so that the changes become visible wxIDirectFBSurfacePtr surface(GetDirectFBSurface()); + + // FIXME: do this only if the surface was modified (as opposed to e.g. + // used only to obtain text metrics) if ( surface ) surface->Flip(NULL, DSFLIP_NONE); } -- 2.45.2