diff --git a/mozilla/allmakefiles.sh b/mozilla/allmakefiles.sh index 6ac76ee6bb7..88f2a6b5b1e 100755 --- a/mozilla/allmakefiles.sh +++ b/mozilla/allmakefiles.sh @@ -520,6 +520,7 @@ widget/src/gtksuperwin/Makefile widget/src/gtkxtbin/Makefile widget/src/photon/Makefile widget/src/mac/Makefile +widget/src/cocoa/Makefile widget/src/xlib/Makefile widget/src/os2/Makefile widget/src/os2/res/Makefile diff --git a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp index b7f3306911b..27c9c744607 100644 --- a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp +++ b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp @@ -432,13 +432,15 @@ nsDeviceContextMac :: FindScreenForSurface ( nsIScreen** outScreen ) return; } - // we have a widget stashed inside, get a native WindowRef out of it nsIWidget* widget = reinterpret_cast(mWidget); // PRAY! NS_ASSERTION ( widget, "No Widget --> No Window" ); if ( !widget ) { NS_IF_ADDREF(*outScreen = mPrimaryScreen.get()); // bail out with the main screen just to be safe. return; - } + } + +#if !MOZ_WIDGET_COCOA + // we have a widget stashed inside, get a native WindowRef out of it WindowRef window = reinterpret_cast(widget->GetNativeData(NS_NATIVE_DISPLAY)); StPortSetter setter(window); @@ -467,6 +469,10 @@ nsDeviceContextMac :: FindScreenForSurface ( nsIScreen** outScreen ) } else *outScreen = nsnull; +#else + // in cocoa, we don't have a windowPtr! bail out with the main screen + NS_IF_ADDREF(*outScreen = mPrimaryScreen.get()); +#endif } // FindScreenForSurface diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 4ab65514ed1..f4e30525bdf 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -3841,10 +3841,9 @@ nsCSSFrameConstructor::HasGfxScrollbars() } } - //return mHasGfxScrollbars; - // we no longer support native scrollbars. Except in form elements. So - // we always return true - return PR_TRUE; + // while we don't support native scrollbars for Seamonkey, some embedding + // clients demand them (but may still want XUL). Give them that option. + return mHasGfxScrollbars; } PRBool diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index 4ab65514ed1..f4e30525bdf 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -3841,10 +3841,9 @@ nsCSSFrameConstructor::HasGfxScrollbars() } } - //return mHasGfxScrollbars; - // we no longer support native scrollbars. Except in form elements. So - // we always return true - return PR_TRUE; + // while we don't support native scrollbars for Seamonkey, some embedding + // clients demand them (but may still want XUL). Give them that option. + return mHasGfxScrollbars; } PRBool diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp index 30c82f9c358..25e3a2c82b9 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp @@ -31,7 +31,7 @@ #include "nsIPref.h" #include "prmem.h" -#ifdef XP_MAC +#if defined(XP_MAC) || defined(XP_MACOSX) #include "nsBrowserWindow.h" #define NS_IMPL_IDS #else diff --git a/mozilla/xpfe/bootstrap/Makefile.in b/mozilla/xpfe/bootstrap/Makefile.in index d2736cfc0c9..b1e19605c12 100644 --- a/mozilla/xpfe/bootstrap/Makefile.in +++ b/mozilla/xpfe/bootstrap/Makefile.in @@ -214,6 +214,13 @@ CPPSRCS += nsNativeAppSupportWin.cpp nsNativeAppSupportBase.cpp OS_LIBS += comctl32.lib comdlg32.lib uuid.lib shell32.lib ole32.lib oleaut32.lib version.lib winspool.lib endif +ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) +CMMSRCS += nsNativeAppSupportCocoa.mm +LDFLAGS += \ + -framework Cocoa \ + $(NULL) +endif + XP_DIST_DEP_LIBS := $(filter-out -L$(DIST)/bin -L$(DIST)/lib, $(XP_DIST_LIBS)) ifeq ($(OS_ARCH),OS2) diff --git a/mozilla/xpfe/bootstrap/nsAppRunner.cpp b/mozilla/xpfe/bootstrap/nsAppRunner.cpp index 66f19691d09..729141f809b 100644 --- a/mozilla/xpfe/bootstrap/nsAppRunner.cpp +++ b/mozilla/xpfe/bootstrap/nsAppRunner.cpp @@ -279,7 +279,7 @@ static const char sWatcherServiceContractID[] = "@mozilla.org/embedcomp/window-w /*********************************************/ // Default implemenations for nativeAppSupport // If your platform implements these functions if def out this code. -#if !defined (XP_MAC ) && !defined(MOZ_WIDGET_PHOTON) && !defined( XP_PC ) && !defined( XP_BEOS ) && !defined(MOZ_WIDGET_GTK) +#if !defined (XP_MAC) && !defined(MOZ_WIDGET_COCOA) && !defined(MOZ_WIDGET_PHOTON) && !defined( XP_PC ) && !defined( XP_BEOS ) && !defined(MOZ_WIDGET_GTK) nsresult NS_CreateSplashScreen( nsISplashScreen **aResult ) { diff --git a/mozilla/xpfe/bootstrap/nsNativeAppSupportCocoa.mm b/mozilla/xpfe/bootstrap/nsNativeAppSupportCocoa.mm index e8fb4e3f397..5f067ab79e4 100644 Binary files a/mozilla/xpfe/bootstrap/nsNativeAppSupportCocoa.mm and b/mozilla/xpfe/bootstrap/nsNativeAppSupportCocoa.mm differ