]> git.saurik.com Git - wxWidgets.git/commitdiff
corrected logic in wxQTMediaEvtHandler::OnEraseBackground(): only erase it if there...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 5 Aug 2005 22:54:45 +0000 (22:54 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 5 Aug 2005 22:54:45 +0000 (22:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35117 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/mediactrl.cpp

index 3f915d4065fad1f5b741e9e2e5ad61d7649563f5..e3595c187fd17ce58a59f7bc5682315237962363 100644 (file)
@@ -4518,23 +4518,27 @@ void wxQTMediaEvtHandler::OnEraseBackground(wxEraseEvent& evt)
 
     if ( m_qtb->m_pMC )
     {
-        //repaint movie controller
+        // repaint movie controller
         m_pLib.MCDoAction(m_qtb->m_pMC, 2 /*mcActionDraw*/,
                             m_pLib.GetNativeWindowPort(m_hwnd));
     }
-    else if(m_qtb->m_movie)
+    else // no movie controller
     {
-        CGrafPtr port = (CGrafPtr)m_pLib.GetNativeWindowPort(m_hwnd);
+        if ( m_qtb->m_movie )
+        {
+            CGrafPtr port = (CGrafPtr)m_pLib.GetNativeWindowPort(m_hwnd);
 
-        m_pLib.BeginUpdate(port);
-        m_pLib.UpdateMovie(m_qtb->m_movie);
-        wxASSERT(m_pLib.GetMoviesError() == noErr);
-        m_pLib.EndUpdate(port);
+            m_pLib.BeginUpdate(port);
+            m_pLib.UpdateMovie(m_qtb->m_movie);
+            wxASSERT(m_pLib.GetMoviesError() == noErr);
+            m_pLib.EndUpdate(port);
+        }
+        else // no movie
+        {
+            // let the system repaint the window
+            evt.Skip();
+        }
     }
-
-    // VZ: this doesn't make sense: why should we erase the background after
-    //     taking the trouble to do whatever we did above? (FIXME)
-    evt.Skip(); //repaint with window background (TODO: maybe !m_movie?)
 }
 
 //---------------------------------------------------------------------------