Issue #1829 - Revert "Issue #1751"

This commit is contained in:
Brian Smith 2022-04-26 11:34:08 -05:00 • committed by roytam1
commit 13fcc4a046
949 changed files with 95662 additions and 444 deletions

View file

@ -112,6 +112,8 @@ MOZ_SAFE_BROWSING:
"linux",
#elif XP_WIN
"win",
#elif XP_MACOSX
"macosx",
#elif XP_LINUX
"linux",
#else

View file

@ -147,6 +147,29 @@ LightweightThemeConsumer.prototype = {
footer.removeAttribute("lwthemefooter");
}
#if defined(XP_MACOSX) && defined(MOZ_CAN_DRAW_IN_TITLEBAR)
// On OS X, we extend the lightweight theme into the titlebar, which means setting
// the chromemargin attribute. Some XUL applications already draw in the titlebar,
// so we need to save the chromemargin value before we overwrite it with the value
// that lets us draw in the titlebar. We stash this value on the root attribute so
// that XUL applications have the ability to invalidate the saved value.
if (stateChanging) {
if (!root.hasAttribute("chromemargin-nonlwtheme")) {
root.setAttribute("chromemargin-nonlwtheme", root.getAttribute("chromemargin"));
}
if (active) {
root.setAttribute("chromemargin", "0,-1,-1,-1");
} else {
let defaultChromemargin = root.getAttribute("chromemargin-nonlwtheme");
if (defaultChromemargin) {
root.setAttribute("chromemargin", defaultChromemargin);
} else {
root.removeAttribute("chromemargin");
}
}
}
#endif
Services.obs.notifyObservers(this._win, "lightweight-theme-window-updated",
JSON.stringify(aData));
}

View file

@ -168,6 +168,17 @@ XPCOMUtils.defineLazyGetter(UpdateUtils, "ABI", function() {
Cu.reportError("XPCOM ABI unknown");
}
#ifdef XP_MACOSX
// Mac universal build should report a different ABI than either macppc
// or mactel.
let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].
getService(Ci.nsIMacUtils);
if (macutils.isUniversalBinary) {
abi += "-u-" + macutils.architecturesInBinary;
}
#endif
return abi;
});

View file

@ -2,7 +2,7 @@
* 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/. */
#if defined(XP_WIN)
#if defined(XP_WIN) || defined(XP_MACOSX)
const HAVE_CSS_WINDOW_DRAG_SUPPORT = true;
#else
const HAVE_CSS_WINDOW_DRAG_SUPPORT = false;

View file

@ -94,7 +94,7 @@ EXTRA_PP_JS_MODULES += [
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3'):
DEFINES['MENUBAR_CAN_AUTOHIDE'] = 1
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3'):
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3', 'cocoa'):
DEFINES['HAVE_SHELL_SERVICE'] = 1
EXTRA_PP_JS_MODULES += [
@ -103,7 +103,7 @@ EXTRA_PP_JS_MODULES += [
]
EXTRA_JS_MODULES += [
EXTRA_PP_JS_MODULES += [
'LightweightThemeConsumer.jsm',
]