]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/controls/ctrl_video.cpp
src/video_output/video_output.c: Fixed double free in filter removal
[vlc] / modules / gui / skins2 / controls / ctrl_video.cpp
index 10e5721385a954c3bb1b0784d93194947c1f8547..ccd7366dc7c40a0fd864e2c2d8766dacf9412f3f 100644 (file)
@@ -26,6 +26,7 @@
 #include "../src/vout_window.hpp"
 #include "../src/os_graphics.hpp"
 #include "../src/vlcproc.hpp"
+#include "../src/window_manager.hpp"
 #include "../commands/async_queue.hpp"
 #include "../commands/cmd_resize.hpp"
 
@@ -100,17 +101,24 @@ void CtrlVideo::draw( OSGraphics &rImage, int xDest, int yDest )
 }
 
 
-void CtrlVideo::onUpdate( Subject<VarBox, void *> &rVoutSize, void *arg )
+void CtrlVideo::onUpdate( Subject<VarBox> &rVoutSize, void *arg )
 {
     int newWidth = ((VarBox&)rVoutSize).getWidth() + m_xShift;
     int newHeight = ((VarBox&)rVoutSize).getHeight() + m_yShift;
 
     // Create a resize command
-    CmdGeneric *pCmd = new CmdResize( getIntf(), m_rLayout, newWidth,
-                                      newHeight );
+    // FIXME: this way of getting the window manager kind of sucks
+    WindowManager &rWindowManager =
+        getIntf()->p_sys->p_theme->getWindowManager();
+    rWindowManager.startResize( m_rLayout, WindowManager::kResizeSE );
+    CmdGeneric *pCmd = new CmdResize( getIntf(), rWindowManager,
+                                      m_rLayout, newWidth, newHeight );
     // Push the command in the asynchronous command queue
     AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
     pQueue->push( CmdGenericPtr( pCmd ) );
+
+    // FIXME: this should be a command too
+    rWindowManager.stopResize();
 }