From 3daf711085889bad1bd68651bc4e8790412ae105 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 26 Apr 2022 10:13:11 -0500 Subject: =?UTF-8?q?Issue=20#1829=20-=20Revert=20=E2=80=9CIssue=20#1751=20-?= =?UTF-8?q?-=20Remove=20XP=5FMACOSX=20conditionals=20from=20the=20rest=20o?= =?UTF-8?q?f=20the=20tree.=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- widget/nsBaseWidget.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'widget/nsBaseWidget.cpp') 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* 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,7 +645,14 @@ 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) { @@ -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()); -- cgit v1.2.3