Commit 3d24634c authored by Damien Fouilleul's avatar Damien Fouilleul

plugin.cpp, oleobject.cpp: fix for ShowDisplay/Visible on activation

vlccontrol.cpp: fixed small mem leak
parent 22f28306
...@@ -163,8 +163,8 @@ HRESULT VLCOleObject::doInPlaceActivate(LPMSG lpMsg, LPOLECLIENTSITE pActiveSite ...@@ -163,8 +163,8 @@ HRESULT VLCOleObject::doInPlaceActivate(LPMSG lpMsg, LPOLECLIENTSITE pActiveSite
p_inPlaceSite->Release(); p_inPlaceSite->Release();
} }
if( _p_instance->getVisible() )
pActiveSite->ShowObject(); pActiveSite->ShowObject();
_p_instance->setVisible(TRUE);
if( NULL != lpMsg ) if( NULL != lpMsg )
{ {
......
...@@ -546,7 +546,7 @@ HRESULT VLCPlugin::onLoad(void) ...@@ -546,7 +546,7 @@ HRESULT VLCPlugin::onLoad(void)
** is the URL of the page the plugin is embedded into. Hence, if the MRL ** 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 ** is a relative URL, we should end up with an absolute URL
*/ */
IOleClientSite *pClientSite; LPOLECLIENTSITE pClientSite;
if( SUCCEEDED(vlcOleObject->GetClientSite(&pClientSite)) && (NULL != pClientSite) ) if( SUCCEEDED(vlcOleObject->GetClientSite(&pClientSite)) && (NULL != pClientSite) )
{ {
IBindCtx *pBC = 0; IBindCtx *pBC = 0;
...@@ -776,7 +776,7 @@ HRESULT VLCPlugin::onActivateInPlace(LPMSG lpMesg, HWND hwndParent, LPCRECT lprc ...@@ -776,7 +776,7 @@ HRESULT VLCPlugin::onActivateInPlace(LPMSG lpMesg, HWND hwndParent, LPCRECT lprc
SetWindowLongPtr(_videownd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this)); SetWindowLongPtr(_videownd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
if( getVisible() ) if( getVisible() )
ShowWindow(_inplacewnd, SW_SHOWNORMAL); ShowWindow(_inplacewnd, SW_SHOW);
/* set internal video width and height */ /* set internal video width and height */
vlc_value_t val; vlc_value_t val;
...@@ -813,10 +813,15 @@ HRESULT VLCPlugin::onInPlaceDeactivate(void) ...@@ -813,10 +813,15 @@ HRESULT VLCPlugin::onInPlaceDeactivate(void)
void VLCPlugin::setVisible(BOOL fVisible) void VLCPlugin::setVisible(BOOL fVisible)
{ {
if( fVisible != _b_visible )
{
_b_visible = fVisible; _b_visible = fVisible;
if( isInPlaceActive() ) if( isInPlaceActive() )
ShowWindow(_inplacewnd, fVisible ? SW_SHOWNORMAL : SW_HIDE); {
ShowWindow(_inplacewnd, fVisible ? SW_SHOW : SW_HIDE);
}
firePropChangedEvent(DISPID_Visible); firePropChangedEvent(DISPID_Visible);
}
}; };
void VLCPlugin::setFocus(BOOL fFocus) void VLCPlugin::setFocus(BOOL fFocus)
......
...@@ -371,6 +371,7 @@ STDMETHODIMP VLCControl::setVariable(BSTR name, VARIANT value) ...@@ -371,6 +371,7 @@ STDMETHODIMP VLCControl::setVariable(BSTR name, VARIANT value)
hr = VariantChangeType(&arg, &value, 0, VT_BSTR); hr = VariantChangeType(&arg, &value, 0, VT_BSTR);
if( SUCCEEDED(hr) ) if( SUCCEEDED(hr) )
{ {
i_type = VLC_VAR_STRING;
val.psz_string = CStrFromBSTR(codePage, V_BSTR(&arg)); val.psz_string = CStrFromBSTR(codePage, V_BSTR(&arg));
VariantClear(&arg); VariantClear(&arg);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment