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
p_inPlaceSite->Release();
}
pActiveSite->ShowObject();
_p_instance->setVisible(TRUE);
if( _p_instance->getVisible() )
pActiveSite->ShowObject();
if( NULL != lpMsg )
{
......
......@@ -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)
......
......@@ -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);
}
......
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