]> git.saurik.com Git - wxWidgets.git/commitdiff
make sure the window is fully painted before DirectFB WM shows it, otherwise artifact...
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 13 Dec 2006 12:08:30 +0000 (12:08 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 13 Dec 2006 12:08:30 +0000 (12:08 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43963 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/dfb/toplevel.cpp

index b5dcc161da77a086deecb8685b937c54f01b2e3c..bb1620b49a1e3a716127b11f34e5fde1db791743 100644 (file)
@@ -270,12 +270,11 @@ bool wxTopLevelWindowDFB::ShowFullScreen(bool show, long style)
 
 bool wxTopLevelWindowDFB::Show(bool show)
 {
+    // NB: this calls wxWindow::Show() and so ensures DoRefreshWindow() is
+    //     called on the window -- we'll need that below
     if ( !wxTopLevelWindowBase::Show(show) )
         return false;
 
-    // hide/show the window by setting its opacity to 0/full:
-    m_dfbwin->SetOpacity(show ? m_opacity : 0);
-
     // If this is the first time Show was called, send size event,
     // so that the frame can adjust itself (think auto layout or single child)
     if ( !m_sizeSet )
@@ -286,6 +285,17 @@ bool wxTopLevelWindowDFB::Show(bool show)
         GetEventHandler()->ProcessEvent(event);
     }
 
+    // make sure the window is fully painted, with all pending updates, before
+    // DFB WM shows it, otherwise it would attempt to show either empty (=
+    // black) window surface (if shown for the first time) or it would show
+    // window with outdated content; note that the window was already refreshed
+    // in the wxTopLevelWindowBase::Show() call above:
+    if ( show )
+        Update();
+
+    // hide/show the window by setting its opacity to 0/full:
+    m_dfbwin->SetOpacity(show ? m_opacity : 0);
+
     if ( show )
     {
         wxWindow *focused = wxWindow::FindFocus();