Bug 1414561 - Port
bug 1414216 to TB: Disable tabs in titlebar when disabled by -moz-gtk-csd-available media feature. r=jorgk
--- a/mail/base/content/msgMail3PaneWindow.js
+++ b/mail/base/content/msgMail3PaneWindow.js
@@ -1656,16 +1656,21 @@ var TabsInTitlebar = {
this.allowedBy("sizemode", false);
window.addEventListener("resize", function (event) {
if (event.target != window)
return;
TabsInTitlebar.allowedBy("sizemode", true);
}, false);
+ // Always disable on unsupported GTK versions.
+ if (AppConstants.MOZ_WIDGET_TOOLKIT == "gtk3") {
+ this.allowedBy("gtk", window.matchMedia("(-moz-gtk-csd-available)"));
+ }
+
// We need to update the appearance of the titlebar when the menu changes
// from the active to the inactive state. We can't, however, rely on
// DOMMenuBarInactive, because the menu fires this event and then removes
// the inactive attribute after an event-loop spin.
//
// Because updating the appearance involves sampling the heights and
// margins of various elements, it's important that the layout be more or
// less settled before updating the titlebar. So instead of listening to