summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llinventorypanel.cpp9
-rw-r--r--indra/newview/llsidetray.h5
2 files changed, 11 insertions, 3 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index baa659df7c..b89a8bfd7d 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -881,10 +881,13 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel()
// Otherwise, open the inventorySP and use that.
if (!res)
{
- LLSD key;
+ LLSideTray *side_tray = LLSideTray::getInstance();
LLSidepanelInventory *sidepanel_inventory =
- dynamic_cast<LLSidepanelInventory *>(LLSideTray::getInstance()->showPanel("sidepanel_inventory", key));
- if (sidepanel_inventory)
+ dynamic_cast<LLSidepanelInventory *>(side_tray->getPanel("sidepanel_inventory"));
+
+ // Use the inventory side panel only if it is already active.
+ // Activating it may unexpectedly switch off the currently active tab in some cases.
+ if (sidepanel_inventory && (LLPanel*)side_tray->getActiveTab() == (LLPanel*)sidepanel_inventory)
{
res = sidepanel_inventory->getActivePanel();
if (res)
diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h
index 7321574681..c90b2d7f8c 100644
--- a/indra/newview/llsidetray.h
+++ b/indra/newview/llsidetray.h
@@ -102,6 +102,11 @@ public:
LLPanel* getPanel (const std::string& panel_name);
/*
+ * get currently active tab
+ */
+ const LLSideTrayTab* getActiveTab() const { return mActiveTab; }
+
+ /*
* collapse SideBar, hiding visible tab and moving tab buttons
* to the right corner of the screen
*/