diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index d51276bf269f66da7d3539569dc13db709b84c03..f014a2a98de5573453d431c7f4061ed54189d6d8 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -114,7 +114,6 @@ LLButton::LLButton(const LLButton::Params& p)
 	mFlashing( FALSE ),
 	mCurGlowStrength(0.f),
 	mNeedsHighlight(FALSE),
-	mMouseOver(false),
 	mUnselectedLabel(p.label()),
 	mSelectedLabel(p.label_selected()),
 	mGLFont(p.font),
@@ -499,11 +498,7 @@ void LLButton::onMouseEnter(S32 x, S32 y, MASK mask)
 	LLUICtrl::onMouseEnter(x, y, mask);
 
 	if (isInEnabledChain())
-	{
 		mNeedsHighlight = TRUE;
-	}
-
-	mMouseOver = true;
 }
 
 void LLButton::onMouseLeave(S32 x, S32 y, MASK mask)
@@ -511,7 +506,6 @@ void LLButton::onMouseLeave(S32 x, S32 y, MASK mask)
 	LLUICtrl::onMouseLeave(x, y, mask);
 
 	mNeedsHighlight = FALSE;
-	mMouseOver = true;
 }
 
 void LLButton::setHighlight(bool b)
@@ -565,10 +559,14 @@ void LLButton::draw()
 	}
 
 	// Unselected image assignments
+	S32 local_mouse_x;
+	S32 local_mouse_y;
+	LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y);
+
 	bool enabled = isInEnabledChain();
 
 	bool pressed = pressed_by_keyboard 
-					|| (hasMouseCapture() && mMouseOver)
+					|| (hasMouseCapture() && pointInView(local_mouse_x, local_mouse_y))
 					|| mForcePressedState;
 	bool selected = getToggleState();
 	
diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h
index d87ceb7c422fe1a22931ec0ada2ee4541a27f2ab..2d5fefa78c89fa4ac2b193c317d70a50a2b67a57 100644
--- a/indra/llui/llbutton.h
+++ b/indra/llui/llbutton.h
@@ -350,7 +350,6 @@ class LLButton
 	BOOL						mCommitOnReturn;
 	BOOL						mFadeWhenDisabled;
 	bool						mForcePressedState;
-	bool						mMouseOver;
 
 	LLFrameTimer				mFlashingTimer;
 };
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 43d18c6d838e91faa3e4c638fe40898ecd39c5d8..0a3a8993eca187e88be6316fcb31e0bb1caf6982 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2486,6 +2486,17 @@ void LLViewerWindow::updateUI()
 	// only update mouse hover set when UI is visible (since we shouldn't send hover events to invisible UI
 	if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
 	{
+		// include all ancestors of captor_view as automatically having mouse
+		if (captor_view)
+		{
+			LLView* captor_parent_view = captor_view->getParent();
+			while(captor_parent_view)
+			{
+				mouse_hover_set.insert(captor_parent_view->getHandle());
+				captor_parent_view = captor_parent_view->getParent();
+			}
+		}
+
 		// aggregate visible views that contain mouse cursor in display order
 		LLPopupView::popup_list_t popups = mPopupView->getCurrentPopups();