summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinspect.cpp24
-rw-r--r--indra/newview/llinspect.h3
-rw-r--r--indra/newview/llinspectavatar.cpp13
-rw-r--r--indra/newview/llinspectobject.cpp11
4 files changed, 46 insertions, 5 deletions
diff --git a/indra/newview/llinspect.cpp b/indra/newview/llinspect.cpp
index c7b8db9635..c7b651f37c 100644
--- a/indra/newview/llinspect.cpp
+++ b/indra/newview/llinspect.cpp
@@ -34,6 +34,7 @@
#include "llcontrol.h" // LLCachedControl
#include "llui.h" // LLUI::sSettingsGroups
+#include "llviewermenu.h"
LLInspect::LLInspect(const LLSD& key)
: LLFloater(key),
@@ -108,3 +109,26 @@ void LLInspect::onMouseLeave(S32 x, S32 y, MASK mask)
{
mOpenTimer.unpause();
}
+
+bool LLInspect::childHasVisiblePopupMenu()
+{
+ // Child text-box may spawn a pop-up menu, if mouse is over the menu, Inspector
+ // will hide(which is not expected).
+ // This is an attempt to find out if child control has spawned a menu.
+
+ LLView* child_menu = gMenuHolder->getVisibleMenu();
+ if(child_menu)
+ {
+ LLRect floater_rc = calcScreenRect();
+ LLRect menu_screen_rc = child_menu->calcScreenRect();
+ S32 mx, my;
+ LLUI::getMousePositionScreen(&mx, &my);
+
+ // This works wrong if we spawn a menu near Inspector and menu overlaps Inspector.
+ if(floater_rc.overlaps(menu_screen_rc) && menu_screen_rc.pointInRect(mx, my))
+ {
+ return true;
+ }
+ }
+ return false;
+}
diff --git a/indra/newview/llinspect.h b/indra/newview/llinspect.h
index a1cb9cd71c..f8c86618d2 100644
--- a/indra/newview/llinspect.h
+++ b/indra/newview/llinspect.h
@@ -56,6 +56,9 @@ public:
/*virtual*/ void onFocusLost();
protected:
+
+ virtual bool childHasVisiblePopupMenu();
+
LLFrameTimer mCloseTimer;
LLFrameTimer mOpenTimer;
};
diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp
index 3a41aebf28..b2cdc0738f 100644
--- a/indra/newview/llinspectavatar.cpp
+++ b/indra/newview/llinspectavatar.cpp
@@ -393,11 +393,18 @@ void LLInspectAvatar::onMouseLeave(S32 x, S32 y, MASK mask)
{
LLMenuGL* gear_menu = getChild<LLMenuButton>("gear_btn")->getMenu();
LLMenuGL* gear_menu_self = getChild<LLMenuButton>("gear_self_btn")->getMenu();
- if ( !(gear_menu && gear_menu->getVisible()) &&
- !(gear_menu_self && gear_menu_self->getVisible()))
+ if ( gear_menu && gear_menu->getVisible() &&
+ gear_menu_self && gear_menu_self->getVisible() )
{
- mOpenTimer.unpause();
+ return;
+ }
+
+ if(childHasVisiblePopupMenu())
+ {
+ return;
}
+
+ mOpenTimer.unpause();
}
void LLInspectAvatar::updateModeratorPanel()
diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp
index dd313c528d..1a5795a2ae 100644
--- a/indra/newview/llinspectobject.cpp
+++ b/indra/newview/llinspectobject.cpp
@@ -575,10 +575,17 @@ void LLInspectObject::updateSecureBrowsing()
void LLInspectObject::onMouseLeave(S32 x, S32 y, MASK mask)
{
LLMenuGL* gear_menu = getChild<LLMenuButton>("gear_btn")->getMenu();
- if ( !(gear_menu && gear_menu->getVisible()))
+ if ( gear_menu && gear_menu->getVisible() )
{
- mOpenTimer.unpause();
+ return;
+ }
+
+ if(childHasVisiblePopupMenu())
+ {
+ return;
}
+
+ mOpenTimer.unpause();
}
void LLInspectObject::onClickBuy()