From 659dc5224e2f4b6ce90b4f739cc015befc098c12 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 1 Dec 2009 15:38:09 -0800 Subject: DEV-42989: Adjust media priority based on app minimization and focus Review #49 This change adjusts each media's priority based on whether the viewer is minimized (media priority becomes HIDDEN) or unfocused (media priority becomes LOW). However, due to the fact that updateMedia() was no longer being called when minimized, I moved its call out of LLViewerTextureList::updateImages() (a seemingly odd place anyway) and into its own idle callback. --- indra/newview/llappviewer.cpp | 2 ++ indra/newview/llviewermedia.cpp | 31 ++++++++++++++++++++++++++++++- indra/newview/llviewermedia.h | 1 + indra/newview/llviewertexturelist.cpp | 4 ---- indra/newview/llviewerwindow.cpp | 4 ++-- 5 files changed, 35 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index eb08707b61..84843138bf 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -899,6 +899,8 @@ bool LLAppViewer::init() loadEventHostModule(gSavedSettings.getS32("QAModeEventHostPort")); } + LLViewerMedia::initClass(); + return true; } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index f2ddb0b1f1..3bc3292876 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -45,6 +45,9 @@ #include "llviewertexturelist.h" #include "llvovolume.h" #include "llpluginclassmedia.h" +#include "llviewerwindow.h" +#include "llfocusmgr.h" +#include "llcallbacklist.h" #include "llevent.h" // LLSimpleListener #include "llnotificationsutil.h" @@ -738,6 +741,19 @@ void LLViewerMedia::updateMedia() impl_count_total++; } + // Overrides if the window is minimized or we lost focus (taking care + // not to accidentally "raise" the priority either) + if (!gViewerWindow->getActive() /* viewer window minimized? */ + && new_priority > LLPluginClassMedia::PRIORITY_HIDDEN) + { + new_priority = LLPluginClassMedia::PRIORITY_HIDDEN; + } + else if (!gFocusMgr.getAppHasFocus() /* viewer window lost focus? */ + && new_priority > LLPluginClassMedia::PRIORITY_LOW) + { + new_priority = LLPluginClassMedia::PRIORITY_LOW; + } + pimpl->setPriority(new_priority); if(pimpl->getUsedInUI()) @@ -774,11 +790,24 @@ void LLViewerMedia::updateMedia() } +// idle callback function...only here to provide a hop to updateMedia() +static void llviewermedia_updatemedia_thunk(void*) +{ + LLViewerMedia::updateMedia(); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMedia::initClass() +{ + gIdleCallbacks.addFunction(llviewermedia_updatemedia_thunk, NULL); +} + ////////////////////////////////////////////////////////////////////////////////////////// // static void LLViewerMedia::cleanupClass() { - // This is no longer necessary, since sViewerMediaImplList is no longer smart pointers. + gIdleCallbacks.deleteFunction(llviewermedia_updatemedia_thunk, NULL); } ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index ac12112ed4..c29bd6dbd6 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -99,6 +99,7 @@ class LLViewerMedia static void updateMedia(); static bool isMusicPlaying(); + static void initClass(); static void cleanupClass(); static void toggleMusicPlay(void*); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index dbcf563010..5be7f2945f 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -614,10 +614,6 @@ void LLViewerTextureList::updateImages(F32 max_time) didone = image->doLoadedCallbacks(); } } - if (!gNoRender && !gGLManager.mIsDisabled) - { - LLViewerMedia::updateMedia(); - } updateImagesUpdateStats(); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f12937194d..1059b200ab 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1011,6 +1011,7 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated) else { mActive = FALSE; + if (gSavedSettings.getBOOL("AllowIdleAFK")) { gAgent.setAFK(); @@ -3242,8 +3243,7 @@ LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, BOOL pick_trans } else { - llwarns << "List of last picks is empty" << llendl; - llwarns << "Using stub pick" << llendl; + lldebugs << "List of last picks is empty: Using stub pick" << llendl; mLastPick = LLPickInfo(); } -- cgit v1.2.3 From 2f0b1d164a939d73aae099c9a3a7eaf76f504eaa Mon Sep 17 00:00:00 2001 From: Ramzi Linden Date: Tue, 1 Dec 2009 16:38:01 -0800 Subject: DEV-43612 (part1) fix a typo in UI text from llmaniptranslate --- indra/newview/llmaniptranslate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 932a3d8a83..765b504afe 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1440,7 +1440,7 @@ void LLManipTranslate::renderSnapGuides() LLVector3 help_text_pos = selection_center_start + (snap_offset_meters_up * 3.f * mSnapOffsetAxis); const LLFontGL* big_fontp = LLFontGL::getFontSansSerif(); - std::string help_text = "Move mouse cursor over ruler to snap"; + std::string help_text = "Move mouse cursor over ruler"; LLColor4 help_text_color = LLColor4::white; help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f); hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); -- cgit v1.2.3 From 15354ab16e7b7f267348f85af6760fdfe65a9550 Mon Sep 17 00:00:00 2001 From: "Eric M. Tulla (BigPapi)" Date: Tue, 1 Dec 2009 20:01:19 -0500 Subject: EXT-2117 - Fix for not being able to add / remove multiple items of different types from your inventory --- indra/newview/llinventorybridge.cpp | 22 ++++++++++++++++------ indra/newview/llinventorybridge.h | 3 +++ 2 files changed, 19 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index a44ce07d76..ac6aa307f2 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1313,6 +1313,16 @@ BOOL LLItemBridge::isItemPermissive() const return FALSE; } +bool LLItemBridge::isAddAction(std::string action) const +{ + return ("wear" == action || "attach" == action || "activate" == action); +} + +bool LLItemBridge::isRemoveAction(std::string action) const +{ + return ("take_off" == action || "detach" == action || "deactivate" == action); +} + // +=================================================+ // | LLFolderBridge | // +=================================================+ @@ -3673,7 +3683,7 @@ std::string LLGestureBridge::getLabelSuffix() const // virtual void LLGestureBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) { - if ("activate" == action) + if (isAddAction(action)) { LLGestureManager::instance().activateGesture(mUUID); @@ -3685,7 +3695,7 @@ void LLGestureBridge::performAction(LLFolderView* folder, LLInventoryModel* mode gInventory.updateItem(item); gInventory.notifyObservers(); } - else if ("deactivate" == action) + else if (isRemoveAction(action)) { LLGestureManager::instance().deactivateGesture(mUUID); @@ -3870,7 +3880,7 @@ LLInventoryObject* LLObjectBridge::getObject() const // virtual void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) { - if ("attach" == action) + if (isAddAction(action)) { LLUUID object_id = mUUID; LLViewerInventoryItem* item; @@ -3893,7 +3903,7 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model } gFocusMgr.setKeyboardFocus(NULL); } - else if ("detach" == action) + else if (isRemoveAction(action)) { LLInventoryItem* item = gInventory.getItem(mUUID); if(item) @@ -4386,7 +4396,7 @@ LLUIImagePtr LLWearableBridge::getIcon() const // virtual void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) { - if ("wear" == action) + if (isAddAction(action)) { wearOnAvatar(); } @@ -4399,7 +4409,7 @@ void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* mod editOnAvatar(); return; } - else if ("take_off" == action) + else if (isRemoveAction(action)) { if(gAgentWearables.isWearingItem(mUUID)) { diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 6a284e0550..ef340af0cb 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -259,6 +259,9 @@ public: virtual void clearDisplayName() { mDisplayName.clear(); } LLViewerInventoryItem* getItem() const; + + bool isAddAction(std::string action) const; + bool isRemoveAction(std::string action) const; protected: virtual BOOL isItemPermissive() const; -- cgit v1.2.3 From f496c2b164a100836d74909c3e27adcdf98018f0 Mon Sep 17 00:00:00 2001 From: Kent Quirk Date: Tue, 1 Dec 2009 20:59:08 -0500 Subject: DEV-43622 : API change (no functionality change) to fix a design error in LLSD I made it about a year and a half ago; Zero found it while reading code. I had added a return value to LLSD::insert(), but a) did it wrong, and b) broke the STL-like semantics of insert(). So I've put insert() back to returning void and created LLSD::with(), which does what my earlier insert() did. The compiler then caught all the cases where insert()'s return value were being used, and I changed those to use with() instead. --- indra/newview/llavatarlistitem.cpp | 2 +- indra/newview/llchathistory.cpp | 6 +++--- indra/newview/lleventnotifier.cpp | 2 +- indra/newview/llfloaterabout.cpp | 2 +- indra/newview/llfloatertestinspectors.cpp | 4 ++-- indra/newview/llgroupactions.cpp | 2 +- indra/newview/llgrouplist.cpp | 2 +- indra/newview/lllocationinputctrl.cpp | 8 ++++---- indra/newview/llnavigationbar.cpp | 2 +- indra/newview/llpanelblockedlist.cpp | 2 +- indra/newview/llpanellandmarks.cpp | 4 ++-- indra/newview/llpanelpeople.cpp | 2 +- indra/newview/llpanelprofile.cpp | 2 +- indra/newview/llstartup.cpp | 6 +++--- indra/newview/lluilistener.cpp | 2 +- indra/newview/llviewermenu.cpp | 2 +- indra/newview/llworldmapview.cpp | 6 +++--- 17 files changed, 28 insertions(+), 28 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index efc9538fa6..3bee5c353f 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -260,7 +260,7 @@ void LLAvatarListItem::setAvatarIconVisible(bool visible) void LLAvatarListItem::onInfoBtnClick() { - LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mAvatarId)); + LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId)); /* TODO fix positioning of inspector localPointToScreen(mXPos, mYPos, &mXPos, &mYPos); diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 078c2518c6..6e1bb961a5 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -78,7 +78,7 @@ public: { LLMuteList::getInstance()->add(LLMute(getAvatarId(), mFrom, LLMute::OBJECT)); - LLSideTray::getInstance()->showPanel("panel_block_list_sidetray", LLSD().insert("blocked_to_select", getAvatarId())); + LLSideTray::getInstance()->showPanel("panel_block_list_sidetray", LLSD().with("blocked_to_select", getAvatarId())); } } @@ -160,11 +160,11 @@ public: { if (mSourceType == CHAT_SOURCE_OBJECT) { - LLFloaterReg::showInstance("inspect_object", LLSD().insert("object_id", mAvatarID)); + LLFloaterReg::showInstance("inspect_object", LLSD().with("object_id", mAvatarID)); } else if (mSourceType == CHAT_SOURCE_AGENT) { - LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mAvatarID)); + LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarID)); } //if chat source is system, you may add "else" here to define behaviour. } diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp index 9c8af16535..b64799bd86 100644 --- a/indra/newview/lleventnotifier.cpp +++ b/indra/newview/lleventnotifier.cpp @@ -197,7 +197,7 @@ bool LLEventNotification::handleResponse(const LLSD& notification, const LLSD& r break; } case 1: - LLFloaterReg::showInstance("search", LLSD().insert("category", "events").insert("id", S32(getEventID()))); + LLFloaterReg::showInstance("search", LLSD().with("category", "events").with("id", S32(getEventID()))); break; case 2: break; diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 58c0c19761..68fc69b4f7 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -312,7 +312,7 @@ public: add("getInfo", "Request an LLSD::Map containing information used to populate About box", &LLFloaterAboutListener::getInfo, - LLSD().insert("reply", LLSD())); + LLSD().with("reply", LLSD())); } private: diff --git a/indra/newview/llfloatertestinspectors.cpp b/indra/newview/llfloatertestinspectors.cpp index 09996b0b92..58d5197eaa 100644 --- a/indra/newview/llfloatertestinspectors.cpp +++ b/indra/newview/llfloatertestinspectors.cpp @@ -82,12 +82,12 @@ void LLFloaterTestInspectors::showAvatarInspector(LLUICtrl*, const LLSD& avatar_ id = avatar_id.asUUID(); } // spawns off mouse position automatically - LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", id)); + LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", id)); } void LLFloaterTestInspectors::showObjectInspector(LLUICtrl*, const LLSD& object_id) { - LLFloaterReg::showInstance("inspect_object", LLSD().insert("object_id", object_id)); + LLFloaterReg::showInstance("inspect_object", LLSD().with("object_id", object_id)); } void LLFloaterTestInspectors::onClickAvatar2D() diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 6fe8ed0e4d..4adefdfcaf 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -113,7 +113,7 @@ LLGroupHandler gGroupHandler; // static void LLGroupActions::search() { - LLFloaterReg::showInstance("search", LLSD().insert("category", "groups")); + LLFloaterReg::showInstance("search", LLSD().with("category", "groups")); } // static diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index cdb85f5b1c..97cf139f1d 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -329,7 +329,7 @@ void LLGroupListItem::setActive(bool active) void LLGroupListItem::onInfoBtnClick() { - LLFloaterReg::showInstance("inspect_group", LLSD().insert("group_id", mGroupID)); + LLFloaterReg::showInstance("inspect_group", LLSD().with("group_id", mGroupID)); } void LLGroupListItem::onProfileBtnClick() diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 9d4dc2b285..d97f1d4d18 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -473,7 +473,7 @@ void LLLocationInputCtrl::draw() void LLLocationInputCtrl::onInfoButtonClicked() { - LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "agent")); + LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "agent")); } void LLLocationInputCtrl::onForSaleButtonClicked() @@ -495,7 +495,7 @@ void LLLocationInputCtrl::onAddLandmarkButtonClicked() } else { - LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "create_landmark")); } } @@ -844,12 +844,12 @@ void LLLocationInputCtrl::onLocationContextMenuItemClicked(const LLSD& userdata) if(!landmark) { - LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "create_landmark")); } else { LLSideTray::getInstance()->showPanel("panel_places", - LLSD().insert("type", "landmark").insert("id",landmark->getUUID())); + LLSD().with("type", "landmark").with("id",landmark->getUUID())); } } else if (item == "cut") diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 41376c4c09..e65b7d8a0c 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -561,7 +561,7 @@ void LLNavigationBar::handleLoginComplete() void LLNavigationBar::invokeSearch(std::string search_text) { - LLFloaterReg::showInstance("search", LLSD().insert("category", "all").insert("id", LLSD(search_text))); + LLFloaterReg::showInstance("search", LLSD().with("category", "all").with("id", LLSD(search_text))); } void LLNavigationBar::clearHistoryCache() diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index 73cffaa7ed..ae703ebd8e 100644 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -104,7 +104,7 @@ void LLPanelBlockedList::selectBlocked(const LLUUID& mute_id) void LLPanelBlockedList::showPanelAndSelect(const LLUUID& idToSelect) { - LLSideTray::getInstance()->showPanel("panel_block_list_sidetray", LLSD().insert(BLOCKED_PARAM_NAME, idToSelect)); + LLSideTray::getInstance()->showPanel("panel_block_list_sidetray", LLSD().with(BLOCKED_PARAM_NAME, idToSelect)); } diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 413d8ed756..3af18bb751 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -596,11 +596,11 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const if(landmark) { LLSideTray::getInstance()->showPanel("panel_places", - LLSD().insert("type", "landmark").insert("id",landmark->getUUID())); + LLSD().with("type", "landmark").with("id",landmark->getUUID())); } else { - LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "create_landmark")); } } else if ("category" == command_name) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 6771bb4170..1743df52fc 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1298,7 +1298,7 @@ void LLPanelPeople::notifyChildren(const LLSD& info) if (container->getCurrentPanelIndex() > 0) { // if not on the default panel, switch to it - container->onOpen(LLSD().insert(LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME, getName())); + container->onOpen(LLSD().with(LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME, getName())); } else LLSideTray::getInstance()->collapseSideBar(); diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 4d152a13f3..1830d00f68 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -68,7 +68,7 @@ public: if (verb == "inspect") { - LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", avatar_id)); + LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", avatar_id)); return true; } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index db8bda008e..50c20bc98f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -482,7 +482,7 @@ bool idle_startup() { std::string diagnostic = "Could not start address resolution system"; LL_WARNS("AppInit") << diagnostic << LL_ENDL; - LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().insert("DIAGNOSTIC", diagnostic)); + LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().with("DIAGNOSTIC", diagnostic)); } // @@ -553,7 +553,7 @@ bool idle_startup() { std::string diagnostic = llformat(" Error: %d", gMessageSystem->getErrorCode()); LL_WARNS("AppInit") << diagnostic << LL_ENDL; - LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().insert("DIAGNOSTIC", diagnostic)); + LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().with("DIAGNOSTIC", diagnostic)); } #if LL_WINDOWS @@ -576,7 +576,7 @@ bool idle_startup() } else { - LLAppViewer::instance()->earlyExit("MessageTemplateNotFound", LLSD().insert("PATH", message_template_path)); + LLAppViewer::instance()->earlyExit("MessageTemplateNotFound", LLSD().with("PATH", message_template_path)); } if(gMessageSystem && gMessageSystem->isOK()) diff --git a/indra/newview/lluilistener.cpp b/indra/newview/lluilistener.cpp index 8b4cfa7248..3ad9887bec 100644 --- a/indra/newview/lluilistener.cpp +++ b/indra/newview/lluilistener.cpp @@ -29,7 +29,7 @@ LLUIListener::LLUIListener(): "Invoke the operation named by [\"function\"], passing [\"parameter\"],\n" "as if from a user gesture on a menu -- or a button click.", &LLUIListener::call, - LLSD().insert("function", LLSD())); + LLSD().with("function", LLSD())); } void LLUIListener::call(const LLSD& event) const diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 34d07f3284..0b40492391 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5360,7 +5360,7 @@ class LLWorldCreateLandmark : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "create_landmark")); return true; } diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 60b1e59645..e6857ea780 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -1728,20 +1728,20 @@ BOOL LLWorldMapView::handleDoubleClick( S32 x, S32 y, MASK mask ) id.toString(uuid_str); uuid_str = uuid_str.substr(28); sscanf(uuid_str.c_str(), "%X", &event_id); - LLFloaterReg::showInstance("search", LLSD().insert("category", "events").insert("id", event_id)); + LLFloaterReg::showInstance("search", LLSD().with("category", "events").with("id", event_id)); break; } case MAP_ITEM_LAND_FOR_SALE: case MAP_ITEM_LAND_FOR_SALE_ADULT: { LLFloaterReg::hideInstance("world_map"); - LLFloaterReg::showInstance("search", LLSD().insert("category", "destinations").insert("id", id)); + LLFloaterReg::showInstance("search", LLSD().with("category", "destinations").with("id", id)); break; } case MAP_ITEM_CLASSIFIED: { LLFloaterReg::hideInstance("world_map"); - LLFloaterReg::showInstance("search", LLSD().insert("category", "classifieds").insert("id", id)); + LLFloaterReg::showInstance("search", LLSD().with("category", "classifieds").with("id", id)); break; } default: -- cgit v1.2.3 From 8bd90b49b1b1c9a500381e2c60e0cec02693d292 Mon Sep 17 00:00:00 2001 From: Runitai <> Date: Wed, 2 Dec 2009 11:46:14 -0600 Subject: EXT-2737 Fix for terrain/avatars/trees not showing up in water reflection. --- indra/newview/pipeline.cpp | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 21b297c4ee..282eddf380 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7189,6 +7189,10 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); glClearColor(0,0,0,0); mWaterRef.bindTarget(); + gGL.setColorMask(true, true); + mWaterRef.clear(); + gGL.setColorMask(true, false); + mWaterRef.getViewport(gGLViewport); stop_glerror(); @@ -7221,6 +7225,21 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) U32 ref_mask = 0; if (LLDrawPoolWater::sNeedsDistortionUpdate) { + //initial sky pass (no user clip plane) + { //mask out everything but the sky + U32 tmp = mRenderTypeMask; + mRenderTypeMask = tmp & ((1 << LLPipeline::RENDER_TYPE_SKY) | + (1 << LLPipeline::RENDER_TYPE_WL_SKY)); + static LLCullResult result; + updateCull(camera, result); + stateSort(camera, result); + mRenderTypeMask = tmp & ((1 << LLPipeline::RENDER_TYPE_SKY) | + (1 << LLPipeline::RENDER_TYPE_CLOUDS) | + (1 << LLPipeline::RENDER_TYPE_WL_SKY)); + renderGeom(camera, TRUE); + mRenderTypeMask = tmp; + } + U32 mask = mRenderTypeMask; mRenderTypeMask &= ~((1< Date: Wed, 2 Dec 2009 12:16:49 -0800 Subject: Minor changes from review feedback get rid of thunk function --- indra/newview/llviewermedia.cpp | 12 +++--------- indra/newview/llviewermedia.h | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 0bee2e3abb..095430dcfc 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -628,7 +628,7 @@ static bool proximity_comparitor(const LLViewerMediaImpl* i1, const LLViewerMedi ////////////////////////////////////////////////////////////////////////////////////////// // static -void LLViewerMedia::updateMedia() +void LLViewerMedia::updateMedia(void *dummy_arg) { impl_list::iterator iter = sViewerMediaImplList.begin(); impl_list::iterator end = sViewerMediaImplList.end(); @@ -799,24 +799,18 @@ void LLViewerMedia::updateMedia() } -// idle callback function...only here to provide a hop to updateMedia() -static void llviewermedia_updatemedia_thunk(void*) -{ - LLViewerMedia::updateMedia(); -} - ////////////////////////////////////////////////////////////////////////////////////////// // static void LLViewerMedia::initClass() { - gIdleCallbacks.addFunction(llviewermedia_updatemedia_thunk, NULL); + gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, NULL); } ////////////////////////////////////////////////////////////////////////////////////////// // static void LLViewerMedia::cleanupClass() { - gIdleCallbacks.deleteFunction(llviewermedia_updatemedia_thunk, NULL); + gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); } ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 8acb485daf..24e7154805 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -96,7 +96,7 @@ class LLViewerMedia static bool textureHasMedia(const LLUUID& texture_id); static void setVolume(F32 volume); - static void updateMedia(); + static void updateMedia(void* dummy_arg = NULL); static bool isMusicPlaying(); static void initClass(); -- cgit v1.2.3 From 050b8ba205f4f59c9b2f471ae494141d9e9f06d6 Mon Sep 17 00:00:00 2001 From: skolb Date: Wed, 2 Dec 2009 16:55:45 -0800 Subject: DEV-42150 crash when using media on a HUD --- indra/newview/llviewerkeyboard.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 8fd646ee93..623d128f87 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -538,8 +538,13 @@ void start_chat( EKeystate s ) void start_gesture( EKeystate s ) { + LLUICtrl* focus_ctrlp = NULL; + if(gFocusMgr.getKeyboardFocus()) + { + focus_ctrlp = dynamic_cast(gFocusMgr.getKeyboardFocus()); + } if (KEYSTATE_UP == s && - !(gFocusMgr.getKeyboardFocus() && dynamic_cast(gFocusMgr.getKeyboardFocus())->acceptsTextInput())) + !(gFocusMgr.getKeyboardFocus() && focus_ctrlp && focus_ctrlp->acceptsTextInput())) { if (LLNearbyChatBar::getInstance()->getCurrentChat().empty()) { -- cgit v1.2.3 From 4e0706f641cd99873def5a3e7b8e808bc219bfcc Mon Sep 17 00:00:00 2001 From: skolb Date: Wed, 2 Dec 2009 17:10:21 -0800 Subject: Cleaned up the conditional code a bit in llviewerkeyboard.cpp, start_gesture --- indra/newview/llviewerkeyboard.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 623d128f87..f757155b94 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -538,13 +538,9 @@ void start_chat( EKeystate s ) void start_gesture( EKeystate s ) { - LLUICtrl* focus_ctrlp = NULL; - if(gFocusMgr.getKeyboardFocus()) - { - focus_ctrlp = dynamic_cast(gFocusMgr.getKeyboardFocus()); - } + LLUICtrl* focus_ctrlp = dynamic_cast(gFocusMgr.getKeyboardFocus()); if (KEYSTATE_UP == s && - !(gFocusMgr.getKeyboardFocus() && focus_ctrlp && focus_ctrlp->acceptsTextInput())) + ! (focus_ctrlp && focus_ctrlp->acceptsTextInput())) { if (LLNearbyChatBar::getInstance()->getCurrentChat().empty()) { -- cgit v1.2.3 From 44d5fcb7765a78d8e148f0a3cd0a23f13d8db3d1 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Wed, 2 Dec 2009 17:34:27 -0800 Subject: Changed the behavior of LLViewerMediaImpl::setDisabled() to interact more predictably with auto-play. Disabling and re-enabling media should work much more like teleporting away and teleporting back -- media will respect the auto-play flag when reloading, instead of returning to its previous load state. --- indra/newview/llviewermedia.cpp | 51 +++++++++++++++++++++++++++++++++-------- indra/newview/llviewermedia.h | 4 +++- 2 files changed, 44 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 095430dcfc..0b8d63b4e6 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -330,6 +330,8 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s media_impl->mMediaLoop = media_entry->getAutoLoop(); media_impl->mMediaWidth = media_entry->getWidthPixels(); media_impl->mMediaHeight = media_entry->getHeightPixels(); + media_impl->mMediaAutoPlay = media_entry->getAutoPlay(); + media_impl->mMediaEntryURL = media_entry->getCurrentURL(); if (media_impl->mMediaSource) { media_impl->mMediaSource->setAutoScale(media_impl->mMediaAutoScale); @@ -337,8 +339,8 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s media_impl->mMediaSource->setSize(media_entry->getWidthPixels(), media_entry->getHeightPixels()); } - bool url_changed = (media_entry->getCurrentURL() != previous_url); - if(media_entry->getCurrentURL().empty()) + bool url_changed = (media_impl->mMediaEntryURL != previous_url); + if(media_impl->mMediaEntryURL.empty()) { if(url_changed) { @@ -353,7 +355,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s // The current media URL is not empty. // If (the media was already loaded OR the media was set to autoplay) AND this update didn't come from this agent, // do a navigate. - bool auto_play = (media_entry->getAutoPlay() && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING)); + bool auto_play = (media_impl->mMediaAutoPlay && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING)); if((was_loaded || auto_play) && !update_from_self) { @@ -375,8 +377,10 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s media_entry->getAutoLoop()); media_impl->setHomeURL(media_entry->getHomeURL()); + media_impl->mMediaAutoPlay = media_entry->getAutoPlay(); + media_impl->mMediaEntryURL = media_entry->getCurrentURL(); - if(media_entry->getAutoPlay() && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING)) + if(media_impl->mMediaAutoPlay && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING)) { needs_navigate = true; } @@ -384,21 +388,20 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s if(media_impl) { - std::string url = media_entry->getCurrentURL(); if(needs_navigate) { - media_impl->navigateTo(url, "", true, true); - lldebugs << "navigating to URL " << url << llendl; + media_impl->navigateTo(media_impl->mMediaEntryURL, "", true, true); + lldebugs << "navigating to URL " << media_impl->mMediaEntryURL << llendl; } - else if(!media_impl->mMediaURL.empty() && (media_impl->mMediaURL != url)) + else if(!media_impl->mMediaURL.empty() && (media_impl->mMediaURL != media_impl->mMediaEntryURL)) { // If we already have a non-empty media URL set and we aren't doing a navigate, update the media URL to match the media entry. - media_impl->mMediaURL = url; + media_impl->mMediaURL = media_impl->mMediaEntryURL; // If this causes a navigate at some point (such as after a reload), it should be considered server-driven so it isn't broadcast. media_impl->mNavigateServerRequest = true; - lldebugs << "updating URL in the media impl to " << url << llendl; + lldebugs << "updating URL in the media impl to " << media_impl->mMediaEntryURL << llendl; } } @@ -853,6 +856,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, mProximity(-1), mProximityDistance(0.0f), mMimeTypeProbe(NULL), + mMediaAutoPlay(false), mIsUpdated(false) { @@ -1934,6 +1938,33 @@ void LLViewerMediaImpl::resetPreviousMediaState() mPreviousMediaTime = 0.0f; } + +////////////////////////////////////////////////////////////////////////////////////////// +// +void LLViewerMediaImpl::setDisabled(bool disabled) +{ + if(mIsDisabled != disabled) + { + // Only do this on actual state transitions. + mIsDisabled = disabled; + + if(mIsDisabled) + { + // We just disabled this media. Clear all state. + unload(); + } + else + { + // We just (re)enabled this media. Do a navigate if auto-play is in order. + if(mMediaAutoPlay && gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING)) + { + navigateTo(mMediaEntryURL, "", true, true); + } + } + + } +}; + ////////////////////////////////////////////////////////////////////////////////////////// // bool LLViewerMediaImpl::isForcedUnloaded() const diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 24e7154805..713eb2710b 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -202,7 +202,7 @@ public: bool isMediaFailed() const { return mMediaSourceFailed; }; void resetPreviousMediaState(); - void setDisabled(bool disabled) { mIsDisabled = disabled; }; + void setDisabled(bool disabled); bool isMediaDisabled() const { return mIsDisabled; }; // returns true if this instance should not be loaded (disabled, muted object, crashed, etc.) @@ -346,6 +346,8 @@ public: S32 mProximity; F64 mProximityDistance; LLMimeDiscoveryResponder *mMimeTypeProbe; + bool mMediaAutoPlay; + std::string mMediaEntryURL; private: BOOL mIsUpdated ; -- cgit v1.2.3 From 533988ee86d942851a79a2833914033e89a05f4d Mon Sep 17 00:00:00 2001 From: skolb Date: Wed, 2 Dec 2009 18:12:30 -0800 Subject: unify the two media auto play preferences into one. The ParcelMediaAutoPlayEnable flag now controls both (horribly named, but must be preserved for legacy purposes). --- indra/newview/llviewermedia.cpp | 2 +- .../skins/default/xui/en/panel_preferences_privacy.xml | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 095430dcfc..abc165e558 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -58,7 +58,7 @@ #include // for SkinFolder listener #include -/*static*/ const char* LLViewerMedia::AUTO_PLAY_MEDIA_SETTING = "AutoPlayMedia"; +/*static*/ const char* LLViewerMedia::AUTO_PLAY_MEDIA_SETTING = "ParcelMediaAutoPlayEnable"; // Move this to its own file. diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml index 23832ba120..29e9b476eb 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml @@ -78,7 +78,7 @@ top_pad="10" width="350" /> - Date: Wed, 2 Dec 2009 18:19:14 -0800 Subject: removed the unused AutoPlayMedia flag. This is now governed by the ParcelMediaAutoPlayEnable flag. --- indra/newview/app_settings/settings.xml | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 63e17058e8..4a65b40658 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -386,17 +386,6 @@ Value 0 - AutoPlayMedia - - Comment - Allow media objects to automatically play or navigate? - Persist - 1 - Type - Boolean - Value - 1 - AutoSnapshot Comment -- cgit v1.2.3