From 3fe3c7cab104635ca9bdb5bfd2ec2223db835f87 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Sun, 26 Sep 1999 22:45:35 +0000 Subject: [PATCH] Fixing XP menus on the Mac so that they paint properly, dismiss properly, etc. git-svn-id: svn://10.0.0.236/trunk@49111 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xul/base/src/nsMenuDismissalListener.cpp | 3 +-- .../layout/xul/base/src/nsMenuPopupFrame.cpp | 22 +++++++------------ 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/mozilla/layout/xul/base/src/nsMenuDismissalListener.cpp b/mozilla/layout/xul/base/src/nsMenuDismissalListener.cpp index 920380f147e..f11ed3785cd 100644 --- a/mozilla/layout/xul/base/src/nsMenuDismissalListener.cpp +++ b/mozilla/layout/xul/base/src/nsMenuDismissalListener.cpp @@ -123,8 +123,7 @@ nsMenuDismissalListener::Unregister() { if (mWidget) mWidget->CaptureRollupEvents(this, PR_FALSE); - else - printf("This is very very bad.\n"); + NS_RELEASE(nsMenuFrame::mDismissalListener); return NS_OK; } diff --git a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp index 051a20c875f..d2b9822496e 100644 --- a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -145,22 +145,16 @@ nsMenuPopupFrame::Init(nsIPresContext& aPresContext, ourView->SetZIndex(kMaxZ); widgetData.mWindowType = eWindowType_popup; widgetData.mBorderStyle = eBorderStyle_default; + +#ifdef XP_MAC + printf("XP Popups: This is a nag to indicate that an inconsistent hack is being done on the Mac for popups.\n"); + static NS_DEFINE_IID(kCPopupCID, NS_POPUP_CID); + ourView->CreateWidget(kCPopupCID, &widgetData, nsnull); +#else static NS_DEFINE_IID(kCChildCID, NS_CHILD_CID); - ourView->CreateWidget(kCChildCID, - &widgetData, - nsnull); + ourView->CreateWidget(kCChildCID, &widgetData, nsnull); +#endif - // Register a listener so that we know when the mouse enters - // the menu (have to use moves, since enter is completely flaky). - - // Create the menu bar listener. - /*mMenuPopupEntryListener = new nsMenuPopupEntryListener(this); - - nsCOMPtr target = do_QueryInterface(mContent); - nsIDOMEventListener* domEventListener = (nsIDOMMouseMotionListener*)mMenuPopupEntryListener; - target->AddEventListener("mousemove", domEventListener, PR_FALSE); - */ - return rv; }