From 9638765196a08ffc364de0f20b06c4121b66463b Mon Sep 17 00:00:00 2001 From: "rjc%netscape.com" Date: Mon, 7 Jun 1999 05:43:09 +0000 Subject: [PATCH] Get context popup menus work on Mac by checking if the CTRL key is down (just like how the Mac's Finder works). --- content/xul/content/src/nsXULPopupListener.cpp | 11 +++++++++-- rdf/content/src/nsXULPopupListener.cpp | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/content/xul/content/src/nsXULPopupListener.cpp b/content/xul/content/src/nsXULPopupListener.cpp index 20d13c12e93c..3c9dbdd386fd 100644 --- a/content/xul/content/src/nsXULPopupListener.cpp +++ b/content/xul/content/src/nsXULPopupListener.cpp @@ -168,10 +168,17 @@ XULPopupListenerImpl::MouseDown(nsIDOMEvent* aMouseEvent) } break; case eXULPopupType_context: +#ifdef XP_MAC + // XXX: Handle Mac (currently checks if CTRL key is down) + PRBool ctrlKey = PR_FALSE; + uiEvent->GetCtrlKey(&ctrlKey); + if (ctrlKey == PR_TRUE) +#else // Check for right mouse button down uiEvent->GetButton(&button); - // XXX: Handle Mac - if (button == 3) { + if (button == 3) +#endif + { // Time to launch a context menu. LaunchPopup(aMouseEvent); } diff --git a/rdf/content/src/nsXULPopupListener.cpp b/rdf/content/src/nsXULPopupListener.cpp index 20d13c12e93c..3c9dbdd386fd 100644 --- a/rdf/content/src/nsXULPopupListener.cpp +++ b/rdf/content/src/nsXULPopupListener.cpp @@ -168,10 +168,17 @@ XULPopupListenerImpl::MouseDown(nsIDOMEvent* aMouseEvent) } break; case eXULPopupType_context: +#ifdef XP_MAC + // XXX: Handle Mac (currently checks if CTRL key is down) + PRBool ctrlKey = PR_FALSE; + uiEvent->GetCtrlKey(&ctrlKey); + if (ctrlKey == PR_TRUE) +#else // Check for right mouse button down uiEvent->GetButton(&button); - // XXX: Handle Mac - if (button == 3) { + if (button == 3) +#endif + { // Time to launch a context menu. LaunchPopup(aMouseEvent); }