Add a global build define to determine if the client can draw in the titlebar...

This commit is contained in:
Fedor 2020-05-07 14:45:39 +03:00
parent 9f63c2ac5e
commit 5238c91b97
4 changed files with 19 additions and 5 deletions

View File

@ -2169,6 +2169,7 @@ MOZ_SERVICES_HEALTHREPORT=1
MOZ_SERVICES_SYNC=1
MOZ_USERINFO=1
NSS_DISABLE_DBM=
MOZ_CAN_DRAW_IN_TITLEBAR=
case "$target_os" in
mingw*)
@ -2703,6 +2704,22 @@ x86_64 | arm | aarch64 | x86 | ppc* | ia64)
esac
dnl ========================================================
dnl = Client drawing in titlebar
dnl ========================================================
if test -n "$MOZ_CAN_DRAW_IN_TITLEBAR"; then
case "$OS_TARGET" in
WINNT|Darwin)
AC_DEFINE(MOZ_CAN_DRAW_IN_TITLEBAR)
;;
*)
AC_MSG_ERROR([Drawing in the titlebar is only supported on Windows and Macintosh targets])
;;
esac
fi
AC_SUBST(MOZ_CAN_DRAW_IN_TITLEBAR)
dnl ========================================================
dnl = Enable WebRTC code
dnl ========================================================

View File

@ -209,7 +209,7 @@ MOZ_SAFE_BROWSING:
#endif
CAN_DRAW_IN_TITLEBAR:
#ifdef CAN_DRAW_IN_TITLEBAR
#ifdef MOZ_CAN_DRAW_IN_TITLEBAR
true,
#else
false,

View File

@ -147,7 +147,7 @@ LightweightThemeConsumer.prototype = {
footer.removeAttribute("lwthemefooter");
}
#ifdef XP_MACOSX
#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

View File

@ -92,9 +92,6 @@ EXTRA_PP_JS_MODULES += [
'WindowDraggingUtils.jsm',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'):
DEFINES['CAN_DRAW_IN_TITLEBAR'] = 1
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3'):
DEFINES['MENUBAR_CAN_AUTOHIDE'] = 1