Fix for bug 257647 (pulldown menus in top-left corner (regression from 223545) on OS X 10.2). r=jhpedemonte, sr=jst.

This commit is contained in:
peterv%propagandism.org 2004-09-17 09:16:56 +00:00
Родитель faef6bd540
Коммит ddee974556
4 изменённых файлов: 12 добавлений и 24 удалений

Просмотреть файл

@ -431,7 +431,7 @@ nsresult nsMacWindow::StandardCreate(nsIWidget *aParent,
// XXX kWindowDoesNotCycleAttribute is only defined in the 10.3 (or
// higher) SDK but MacWindows.h claims it should work on 10.2
// and higher.
if (nsToolkit::OSXVersion() > MAC_OS_X_VERSION_10_2)
if (nsToolkit::OSXVersion() >= MAC_OS_X_VERSION_10_2_HEX)
{
attributes = (1L << 15); // kWindowDoesNotCycleAttribute
}
@ -459,7 +459,7 @@ nsresult nsMacWindow::StandardCreate(nsIWidget *aParent,
wRect.right - wRect.left, wRect.bottom - wRect.top,
getter_AddRefs(screen));
if (screen) {
PRInt32 left, top, width, height;
PRInt32 left, top, width, height;
screen->GetAvailRect(&left, &top, &width, &height);
if (wRect.bottom > top+height) {
bottomPinDelta = wRect.bottom - (top+height);
@ -468,18 +468,7 @@ nsresult nsMacWindow::StandardCreate(nsIWidget *aParent,
}
}
// XXX Need to special-case for OS X versions below 10.1, because
// kSimpleWindowClass doesn't exist.
if (mWindowType == eWindowType_popup &&
nsToolkit::OSXVersion() < MAC_OS_X_VERSION_10_1)
{
mWindowPtr = ::NewCWindow(nil, &wRect, "\p", false, kWindowSimpleProc,
(WindowRef)-1, false, (long)nsnull);
}
else
{
::CreateNewWindow(windowClass, attributes, &wRect, &mWindowPtr);
}
::CreateNewWindow(windowClass, attributes, &wRect, &mWindowPtr);
mWindowMadeHere = PR_TRUE;
@ -1437,7 +1426,6 @@ NS_IMETHODIMP nsMacWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepai
short w = macRect.right - macRect.left;
short h = macRect.bottom - macRect.top;
Boolean needReposition = (w == 1 && h == 1);
if ((w != aWidth) || (h != aHeight))
{
@ -1455,12 +1443,6 @@ NS_IMETHODIMP nsMacWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepai
}
mResizeIsFromUs = PR_FALSE;
#if defined(XP_MACOSX)
// workaround for bug in MacOSX if windows start life as 1x1.
if (needReposition)
RepositionWindow(mWindowPtr, NULL, kWindowCascadeOnMainScreen);
#endif
}
}
Inherited::Resize(aWidth, aHeight, aRepaint);

Просмотреть файл

@ -268,7 +268,7 @@ nsToolkit :: OSXVersion()
OSErr err = ::Gestalt(gestaltSystemVersion, &gOSXVersion);
if (err != noErr) {
NS_ERROR("Couldn't determine OS X version, assume 10.0");
gOSXVersion = MAC_OS_X_VERSION_10_0;
gOSXVersion = MAC_OS_X_VERSION_10_0_HEX;
}
}
return gOSXVersion;

Просмотреть файл

@ -76,6 +76,10 @@
class nsIEventSink;
class nsIWidget;
#define MAC_OS_X_VERSION_10_0_HEX 0x00001000
#define MAC_OS_X_VERSION_10_1_HEX 0x00001010
#define MAC_OS_X_VERSION_10_2_HEX 0x00001020
#define MAC_OS_X_VERSION_10_3_HEX 0x00001030
class nsToolkit : public nsToolkitBase
{

Просмотреть файл

@ -701,7 +701,8 @@ PRBool OnJaguarOrLater() // Return true if we are on Mac OS X 10.2 or later
static PRBool gOnJaguarOrLater = PR_FALSE;
if(!gInitVer)
{
gOnJaguarOrLater = (nsToolkit::OSXVersion() >= MAC_OS_X_VERSION_10_2);
gOnJaguarOrLater =
(nsToolkit::OSXVersion() >= MAC_OS_X_VERSION_10_2_HEX);
gInitVer = PR_TRUE;
}
return gOnJaguarOrLater;
@ -713,7 +714,8 @@ PRBool OnPantherOrLater() // Return true if we are on Mac OS X 10.3 or later
static PRBool gOnPantherOrLater = PR_FALSE;
if(!gInitVer1030)
{
gOnPantherOrLater = (nsToolkit::OSXVersion() >= 0x00001030);
gOnPantherOrLater =
(nsToolkit::OSXVersion() >= MAC_OS_X_VERSION_10_3_HEX);
gInitVer1030 = PR_TRUE;
}
return gOnPantherOrLater;