Bug 1414561 - Port bug 1414216 to TB: Disable tabs in titlebar when disabled by -moz-gtk-csd-available media feature. r=jorgk
authorRichard Marti <richard.marti@gmail.com>
Sat, 04 Nov 2017 12:29:29 +0100
changeset 29317 cda5ad0fab2b9e1f7dc8d7b7248a24a0a0b2c177
parent 29316 b35420759ed0ff975d931998286257d0a1e21d43
child 29318 23aa8cfaeb0db5089e7045cf7c4da86b515d720c
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1414561, 1414216
Bug 1414561 - Port bug 1414216 to TB: Disable tabs in titlebar when disabled by -moz-gtk-csd-available media feature. r=jorgk
mail/base/content/msgMail3PaneWindow.js
--- 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