]> git.sesse.net Git - vlc/commitdiff
plugin.cpp, oleobject.cpp: fix for ShowDisplay/Visible on activation
authorDamien Fouilleul <damienf@videolan.org>
Mon, 23 Jan 2006 12:00:00 +0000 (12:00 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Mon, 23 Jan 2006 12:00:00 +0000 (12:00 +0000)
vlccontrol.cpp: fixed small mem leak

activex/oleobject.cpp
activex/plugin.cpp
activex/vlccontrol.cpp

index 3101d91a6f98d6e9da79299906d7af17c358196c..03b2f350e891d0e598f1d4f2aabbfca4abfff8c5 100644 (file)
@@ -163,8 +163,8 @@ HRESULT VLCOleObject::doInPlaceActivate(LPMSG lpMsg, LPOLECLIENTSITE pActiveSite
             p_inPlaceSite->Release();
         }
 
-        pActiveSite->ShowObject();
-        _p_instance->setVisible(TRUE);
+        if( _p_instance->getVisible() )
+            pActiveSite->ShowObject();
 
         if( NULL != lpMsg )
         {
index 0ef6092d43d6eea9a408cbaa3998e84409c6846c..b8c6086f9997d679e28f1c402749370d453032d3 100644 (file)
@@ -546,7 +546,7 @@ HRESULT VLCPlugin::onLoad(void)
         ** is the URL of the page the plugin is embedded into. Hence, if the MRL
         ** is a relative URL, we should end up with an absolute URL
         */
-        IOleClientSite *pClientSite;
+        LPOLECLIENTSITE pClientSite;
         if( SUCCEEDED(vlcOleObject->GetClientSite(&pClientSite)) && (NULL != pClientSite) )
         {
             IBindCtx *pBC = 0;
@@ -776,7 +776,7 @@ HRESULT VLCPlugin::onActivateInPlace(LPMSG lpMesg, HWND hwndParent, LPCRECT lprc
     SetWindowLongPtr(_videownd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
 
     if( getVisible() )
-        ShowWindow(_inplacewnd, SW_SHOWNORMAL);
+        ShowWindow(_inplacewnd, SW_SHOW);
 
     /* set internal video width and height */
     vlc_value_t val;
@@ -813,10 +813,15 @@ HRESULT VLCPlugin::onInPlaceDeactivate(void)
 
 void VLCPlugin::setVisible(BOOL fVisible)
 {
-    _b_visible = fVisible;
-    if( isInPlaceActive() )
-        ShowWindow(_inplacewnd, fVisible ? SW_SHOWNORMAL : SW_HIDE);
-    firePropChangedEvent(DISPID_Visible);
+    if( fVisible != _b_visible )
+    {
+        _b_visible = fVisible;
+        if( isInPlaceActive() )
+        {
+            ShowWindow(_inplacewnd, fVisible ? SW_SHOW : SW_HIDE);
+        }
+        firePropChangedEvent(DISPID_Visible);
+    }
 };
 
 void VLCPlugin::setFocus(BOOL fFocus)
index 61d611aff7ab49f2aff15d182554d9cbef2f4998..783451be15ceadb1651a9341c93a5d239248b384 100644 (file)
@@ -371,6 +371,7 @@ STDMETHODIMP VLCControl::setVariable(BSTR name, VARIANT value)
                     hr = VariantChangeType(&arg, &value, 0, VT_BSTR);
                     if( SUCCEEDED(hr) )
                     {
+                        i_type = VLC_VAR_STRING;
                         val.psz_string = CStrFromBSTR(codePage, V_BSTR(&arg));
                         VariantClear(&arg);
                     }