diff options
author | Moonchild <moonchild@palemoon.org> | 2021-05-06 09:24:03 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-05-06 09:24:03 +0000 |
commit | 6f707bde95dab6998ac204f9ee6c925ee230c740 (patch) | |
tree | 859f6cf99f2e026b76dcc40b27b211154310d16e /xpfe | |
parent | aa0fd3d68c856504646e1d7eb499bc890ef44101 (diff) | |
download | uxp-6f707bde95dab6998ac204f9ee6c925ee230c740.tar.gz |
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.
Diffstat (limited to 'xpfe')
-rw-r--r-- | xpfe/appshell/nsAppShellService.cpp | 43 | ||||
-rw-r--r-- | xpfe/appshell/nsContentTreeOwner.cpp | 37 | ||||
-rw-r--r-- | xpfe/appshell/nsWebShellWindow.cpp | 2 | ||||
-rw-r--r-- | xpfe/appshell/nsXULWindow.cpp | 3 |
4 files changed, 2 insertions, 83 deletions
diff --git a/xpfe/appshell/nsAppShellService.cpp b/xpfe/appshell/nsAppShellService.cpp index f2497d0e03..868bd78123 100644 --- a/xpfe/appshell/nsAppShellService.cpp +++ b/xpfe/appshell/nsAppShellService.cpp @@ -112,20 +112,8 @@ nsAppShellService::CreateHiddenWindowHelper(bool aIsPrivate) nsresult rv; int32_t initialHeight = 100, initialWidth = 100; -#ifdef XP_MACOSX - uint32_t chromeMask = 0; - nsAdoptingCString prefVal = - Preferences::GetCString("browser.hiddenWindowChromeURL"); - const char* hiddenWindowURL = prefVal.get() ? prefVal.get() : DEFAULT_HIDDENWINDOW_URL; - if (aIsPrivate) { - hiddenWindowURL = DEFAULT_HIDDENWINDOW_URL; - } else { - mApplicationProvidedHiddenWindow = prefVal.get() ? true : false; - } -#else static const char hiddenWindowURL[] = DEFAULT_HIDDENWINDOW_URL; uint32_t chromeMask = nsIWebBrowserChrome::CHROME_ALL; -#endif nsCOMPtr<nsIURI> url; rv = NS_NewURI(getter_AddRefs(url), hiddenWindowURL); @@ -555,26 +543,12 @@ nsAppShellService::CalculateWindowZLevel(nsIXULWindow *aParent, else if (aChromeMask & nsIWebBrowserChrome::CHROME_WINDOW_LOWERED) zLevel = nsIXULWindow::loweredZ; -#ifdef XP_MACOSX - /* Platforms on which modal windows are always application-modal, not - window-modal (that's just the Mac, right?) want modal windows to - be stacked on top of everyone else. - - On Mac OS X, bind modality to parent window instead of app (ala Mac OS 9) - */ - uint32_t modalDepMask = nsIWebBrowserChrome::CHROME_MODAL | - nsIWebBrowserChrome::CHROME_DEPENDENT; - if (aParent && (aChromeMask & modalDepMask)) { - aParent->GetZLevel(&zLevel); - } -#else /* Platforms with native support for dependent windows (that's everyone but pre-Mac OS X, right?) know how to stack dependent windows. On these platforms, give the dependent window the same level as its parent, so we won't try to override the normal platform behaviour. */ if ((aChromeMask & nsIWebBrowserChrome::CHROME_DEPENDENT) && aParent) aParent->GetZLevel(&zLevel); -#endif return zLevel; } @@ -661,23 +635,6 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent, if (aChromeMask & nsIWebBrowserChrome::CHROME_MAC_SUPPRESS_ANIMATION) widgetInitData.mIsAnimationSuppressed = true; -#ifdef XP_MACOSX - // Mac OS X sheet support - // Adding CHROME_OPENAS_CHROME to sheetMask makes modal windows opened from - // nsGlobalWindow::ShowModalDialog() be dialogs (not sheets), while modal - // windows opened from nsPromptService::DoDialog() still are sheets. This - // fixes bmo bug 395465 (see nsCocoaWindow::StandardCreate() and - // nsCocoaWindow::SetModal()). - uint32_t sheetMask = nsIWebBrowserChrome::CHROME_OPENAS_DIALOG | - nsIWebBrowserChrome::CHROME_MODAL | - nsIWebBrowserChrome::CHROME_OPENAS_CHROME; - if (parent && - (parent != mHiddenWindow && parent != mHiddenPrivateWindow) && - ((aChromeMask & sheetMask) == sheetMask)) { - widgetInitData.mWindowType = eWindowType_sheet; - } -#endif - #if defined(XP_WIN) if (widgetInitData.mWindowType == eWindowType_toplevel || widgetInitData.mWindowType == eWindowType_dialog) diff --git a/xpfe/appshell/nsContentTreeOwner.cpp b/xpfe/appshell/nsContentTreeOwner.cpp index 8e9a065a9c..c916f74d0e 100644 --- a/xpfe/appshell/nsContentTreeOwner.cpp +++ b/xpfe/appshell/nsContentTreeOwner.cpp @@ -40,9 +40,6 @@ #include "nsIScriptObjectPrincipal.h" #include "nsIURI.h" #include "nsIDocument.h" -#if defined(XP_MACOSX) -#include "nsThreadUtils.h" -#endif #include "mozilla/Preferences.h" #include "mozilla/dom/Element.h" @@ -906,28 +903,6 @@ nsContentTreeOwner::ProvideWindow(mozIDOMWindowProxy* aParent, // nsContentTreeOwner: Accessors //***************************************************************************** -#if defined(XP_MACOSX) -class nsContentTitleSettingEvent : public Runnable -{ -public: - nsContentTitleSettingEvent(dom::Element* dse, const nsAString& wtm) - : mElement(dse), - mTitleDefault(wtm) {} - - NS_IMETHOD Run() override - { - ErrorResult rv; - mElement->SetAttribute(NS_LITERAL_STRING("titledefault"), mTitleDefault, rv); - mElement->RemoveAttribute(NS_LITERAL_STRING("titlemodifier"), rv); - return NS_OK; - } - -private: - nsCOMPtr<dom::Element> mElement; - nsString mTitleDefault; -}; -#endif - void nsContentTreeOwner::XULWindow(nsXULWindow* aXULWindow) { mXULWindow = aXULWindow; @@ -946,18 +921,6 @@ void nsContentTreeOwner::XULWindow(nsXULWindow* aXULWindow) docShellElement->GetAttribute(NS_LITERAL_STRING("titledefault"), mTitleDefault); docShellElement->GetAttribute(NS_LITERAL_STRING("titlemodifier"), mWindowTitleModifier); docShellElement->GetAttribute(NS_LITERAL_STRING("titlepreface"), mTitlePreface); - -#if defined(XP_MACOSX) - // On OS X, treat the titlemodifier like it's the titledefault, and don't ever append - // the separator + appname. - if (mTitleDefault.IsEmpty()) { - NS_DispatchToCurrentThread( - new nsContentTitleSettingEvent(docShellElement, - mWindowTitleModifier)); - mTitleDefault = mWindowTitleModifier; - mWindowTitleModifier.Truncate(); - } -#endif docShellElement->GetAttribute(NS_LITERAL_STRING("titlemenuseparator"), mTitleSeparator); } } diff --git a/xpfe/appshell/nsWebShellWindow.cpp b/xpfe/appshell/nsWebShellWindow.cpp index 2893e78682..7ec39a9cdf 100644 --- a/xpfe/appshell/nsWebShellWindow.cpp +++ b/xpfe/appshell/nsWebShellWindow.cpp @@ -73,7 +73,7 @@ #include "nsPIWindowRoot.h" -#if defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK) +#if defined(MOZ_WIDGET_GTK) #include "nsINativeMenuService.h" #define USE_NATIVE_MENUS #endif diff --git a/xpfe/appshell/nsXULWindow.cpp b/xpfe/appshell/nsXULWindow.cpp index 5850850651..45403b2b0a 100644 --- a/xpfe/appshell/nsXULWindow.cpp +++ b/xpfe/appshell/nsXULWindow.cpp @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 ci et: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -1040,7 +1039,7 @@ void nsXULWindow::OnChromeLoaded() bool positionSet = !mIgnoreXULPosition; nsCOMPtr<nsIXULWindow> parentWindow(do_QueryReferent(mParentWindow)); -#if defined(XP_UNIX) && !defined(XP_MACOSX) +#if defined(XP_UNIX) // don't override WM placement on unix for independent, top-level windows // (however, we think the benefits of intelligent dependent window placement // trump that override.) |