]> git.saurik.com Git - wxWidgets.git/commitdiff
verify that we're not painting on hidden window (which is not implemented)
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 7 Sep 2006 11:14:52 +0000 (11:14 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 7 Sep 2006 11:14:52 +0000 (11:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/dfb/dcclient.cpp

index 7f02fbeddea73cf042a483654aacd21413f98696..36a57c83306344076d57d615b1e5d91edd94e17a 100644 (file)
@@ -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);
 }