diff options
author | Brian Smith <brian@dbsoft.org> | 2022-04-26 10:13:11 -0500 |
---|---|---|
committer | Brian Smith <brian@dbsoft.org> | 2022-04-26 10:19:04 -0500 |
commit | 3daf711085889bad1bd68651bc4e8790412ae105 (patch) | |
tree | f5b0e4c1befb320cdf158e1839ac5e273373087f /widget/nsBaseWidget.cpp | |
parent | 7fe702603066e7f122d5dd66a3a1892ac7e06215 (diff) | |
download | uxp-3daf711085889bad1bd68651bc4e8790412ae105.tar.gz |
Issue #1829 - Revert “Issue #1751 -- Remove XP_MACOSX conditionals from the rest of the tree.”
This also removes some PP abuse and takes file entries out of PP when no longer
needed without XP_MACOSX conditionals.
This reverts commit 6f707bde95dab6998ac204f9ee6c925ee230c740.
Diffstat (limited to 'widget/nsBaseWidget.cpp')
-rw-r--r-- | widget/nsBaseWidget.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp index 23859383c2..d3cdf72cfc 100644 --- a/widget/nsBaseWidget.cpp +++ b/widget/nsBaseWidget.cpp @@ -84,6 +84,10 @@ static void debug_RegisterPrefCallbacks(); static int32_t gNumWidgets; #endif +#ifdef XP_MACOSX +#include "nsCocoaFeatures.h" +#endif + #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) static nsRefPtrHashtable<nsVoidPtrHashKey, nsIWidget>* sPluginWidgetList; #endif @@ -171,7 +175,7 @@ nsBaseWidget::nsBaseWidget() , mUpdateCursor(true) , mUseAttachedEvents(false) , mIMEHasFocus(false) -#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) +#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK) , mAccessibilityInUseFlag(false) #endif { @@ -641,8 +645,15 @@ void nsBaseWidget::AddChild(nsIWidget* aChild) void nsBaseWidget::RemoveChild(nsIWidget* aChild) { #ifdef DEBUG +#ifdef XP_MACOSX + // nsCocoaWindow doesn't implement GetParent, so in that case parent will be + // null and we'll just have to do without this assertion. + nsIWidget* parent = aChild->GetParent(); + NS_ASSERTION(!parent || parent == this, "Not one of our kids!"); +#else MOZ_RELEASE_ASSERT(aChild->GetParent() == this, "Not one of our kids!"); #endif +#endif if (mLastChild == aChild) { mLastChild = mLastChild->GetPrevSibling(); @@ -1371,8 +1382,12 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight) mLayerManager = lm.forget(); // Only track compositors for top-level windows, since other window types - // may use the basic compositor. + // may use the basic compositor. Except on the OS X - see bug 1306383 +#if defined(XP_MACOSX) + bool getCompositorFromThisWindow = true; +#else bool getCompositorFromThisWindow = (mWindowType == eWindowType_toplevel); +#endif if (getCompositorFromThisWindow) { gfxPlatform::GetPlatform()->NotifyCompositorCreated(mLayerManager->GetCompositorBackendType()); @@ -1870,7 +1885,7 @@ nsBaseWidget::ZoomToRect(const uint32_t& aPresShellId, #ifdef ACCESSIBILITY -#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) +#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK) // defined in nsAppRunner.cpp extern const char* kAccessibilityLastRunDatePref; @@ -1899,7 +1914,7 @@ nsBaseWidget::GetRootAccessible() // make sure it's not created at unsafe times. nsAccessibilityService* accService = GetOrCreateAccService(); if (accService) { -#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) +#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK) if (!mAccessibilityInUseFlag) { mAccessibilityInUseFlag = true; uint32_t now = PRTimeToSeconds(PR_Now()); |