diff --git a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp index 6bf6d429cbf..fdf99996e7d 100644 --- a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -20,6 +20,7 @@ * Original Author: David W. Hyatt (hyatt@netscape.com) * * Contributor(s): + * Mike Pinkerton (pinkerton@netscape.com) * Dean Tessman */ @@ -101,8 +102,9 @@ NS_INTERFACE_MAP_END_INHERITING(nsBoxFrame) // // nsMenuPopupFrame ctor // -nsMenuPopupFrame::nsMenuPopupFrame(nsIPresShell* aShell):nsBoxFrame(aShell), -mCurrentMenu(nsnull), mTimerMenu(nsnull), mCloseTimer(nsnull) +nsMenuPopupFrame::nsMenuPopupFrame(nsIPresShell* aShell) + :nsBoxFrame(aShell), mCurrentMenu(nsnull), mTimerMenu(nsnull), mCloseTimer(nsnull), + mMenuCanOverlapOSBar(PR_FALSE) { SetIsContextMenu(PR_FALSE); // we're not a context menu by default @@ -118,6 +120,14 @@ nsMenuPopupFrame::Init(nsIPresContext* aPresContext, { nsresult rv = nsBoxFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow); + // lookup if we're allowed to overlap the OS bar (menubar/taskbar) from the + // look&feel object + nsCOMPtr lookAndFeel; + nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, + getter_AddRefs(lookAndFeel)); + if ( lookAndFeel ) + lookAndFeel->GetMetric(nsILookAndFeel::eMetric_MenusCanOverlapOSBar, mMenuCanOverlapOSBar); + // XXX Hack mPresContext = aPresContext; @@ -532,8 +542,14 @@ nsMenuPopupFrame::SyncViewWithFrame(nsIPresContext* aPresContext, window->GetScreen(getter_AddRefs(screen)); PRInt32 screenWidth; PRInt32 screenHeight; - screen->GetAvailWidth(&screenWidth); - screen->GetAvailHeight(&screenHeight); + if ( mMenuCanOverlapOSBar ) { + screen->GetWidth(&screenWidth); + screen->GetHeight(&screenHeight); + } + else { + screen->GetAvailWidth(&screenWidth); + screen->GetAvailHeight(&screenHeight); + } // Compute info about the screen dimensions. Because of multiple monitor systems, // the left or top sides of the screen may be in negative space (main monitor is on the diff --git a/mozilla/layout/xul/base/src/nsMenuPopupFrame.h b/mozilla/layout/xul/base/src/nsMenuPopupFrame.h index f7302bc7b85..b593c49e066 100644 --- a/mozilla/layout/xul/base/src/nsMenuPopupFrame.h +++ b/mozilla/layout/xul/base/src/nsMenuPopupFrame.h @@ -19,7 +19,8 @@ * * Original Author: David W. Hyatt (hyatt@netscape.com) * - * Contributor(s): + * Contributor(s): + * Mike Pinkerton (pinkerton@netscape.com) * Dean Tessman */ @@ -167,6 +168,8 @@ protected: nsCOMPtr mCloseTimer; // Close timer. PRBool mIsContextMenu; // is this a context menu? + + PRBool mMenuCanOverlapOSBar; // can we appear over the taskbar/menubar? }; // class nsMenuPopupFrame