From 239089d2a4ff9a4b77b1d810ede3b0692fdb9a66 Mon Sep 17 00:00:00 2001 From: "blakeross%telocity.com" Date: Wed, 20 Jun 2001 05:46:38 +0000 Subject: [PATCH] Widgets visually respond/depress on right click (45533). r=kerz sr=ben a=asa --- content/events/src/nsEventStateManager.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index 921178808b2..440588ac603 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -1501,6 +1501,10 @@ nsEventStateManager::PostHandleEvent(nsIPresContext* aPresContext, SetContentState(nsnull, NS_EVENT_STATE_FOCUS); } + // The rest is left button-specific. + if (aEvent->message != NS_MOUSE_LEFT_BUTTON_DOWN) + break; + if (activeContent) { // The nearest enclosing element goes into the // :active state. If we fail the QI to DOMElement, @@ -1511,15 +1515,13 @@ nsEventStateManager::PostHandleEvent(nsIPresContext* aPresContext, if (!elt) { nsCOMPtr par; activeContent->GetParent(*getter_AddRefs(par)); - activeContent = par; - } - if (activeContent) { - SetContentState(activeContent, NS_EVENT_STATE_ACTIVE); - nsCOMPtr bodyElement(do_QueryInterface(activeContent)); - if (bodyElement) { - mSpecialTopOfDoc = PR_TRUE; - } + if (par) + activeContent = par; } + SetContentState(activeContent, NS_EVENT_STATE_ACTIVE); + nsCOMPtr bodyElement(do_QueryInterface(activeContent)); + if (bodyElement) + mSpecialTopOfDoc = PR_TRUE; } } else {