diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 76d38f067d..53a5fe2d36 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -313,12 +313,21 @@ void LLPanelPrimMediaControls::updateShape() if (objectp) { + // VWR-29449; Remeber if user has MEDIA_PERM_CONTROL + bool hasPermsControl = true; + // + bool mini_controls = false; LLMediaEntry *media_data = objectp->getTE(mTargetObjectFace)->getMediaData(); if (media_data && NULL != dynamic_cast(objectp)) { // Don't show the media controls if we do not have permissions enabled = dynamic_cast(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL); + + // VWR-29449; Remeber if user has MEDIA_PERM_CONTROL + hasPermsControl = dynamic_cast(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL); + // + mini_controls = (LLMediaEntry::MINI == media_data->getControls()); } const bool is_hud = objectp->isHUDAttachment(); @@ -563,8 +572,36 @@ void LLPanelPrimMediaControls::updateShape() } } - setVisible(enabled); + // VWR-29449; If this is a HUD always set it visible, but hide each control if user has no perms. + // When setting it invisible it won't receive any mouse messages anymore, thus eg trying to sroll a webpage with mousewheel has surprising effects. + + // setVisible(enabled); + if( !is_hud ) + setVisible(enabled); + else + { + if( !hasPermsControl ) + { + mBackCtrl->setVisible(false); + mFwdCtrl->setVisible(false); + mReloadCtrl->setVisible(false); + mStopCtrl->setVisible(false); + mHomeCtrl->setVisible(false); + mZoomCtrl->setVisible(false); + mUnzoomCtrl->setVisible(false); + mOpenCtrl->setVisible(false); + mMediaAddressCtrl->setVisible(false); + mMediaPlaySliderPanel->setVisible(false); + mVolumeCtrl->setVisible(false); + mMediaProgressPanel->setVisible(false); + mVolumeSliderCtrl->setVisible(false); + } + + setVisible(true); + } + // + // // Calculate position and shape of the controls // @@ -765,10 +802,23 @@ void LLPanelPrimMediaControls::draw() // ignore space from right bookend padding controls_bg_area.mRight -= mRightBookend->getRect().getWidth() - space - 2; - + // draw control background UI image - mBackgroundImage->draw( controls_bg_area, UI_VERTEX_COLOR % alpha); + + // VWR-29449; Only draw mBackgroundImage when the user has MEDIA_PERM_CONTROL. Otherwise we did hide all media controls above and drawing mBackgroundImage draws a useless grey square. + // mBackgroundImage->draw( controls_bg_area, UI_VERTEX_COLOR % alpha); + + LLViewerObject* objectp = getTargetObject(); + LLMediaEntry *media_data(0); + + if( objectp ) + media_data = objectp->getTE(mTargetObjectFace)->getMediaData(); + if( !dynamic_cast(objectp) || !media_data || dynamic_cast(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL) ) + mBackgroundImage->draw( controls_bg_area, UI_VERTEX_COLOR % alpha); + + // + // draw volume slider background UI image if (mVolumeSliderCtrl->getVisible()) {