Bug 1521199 - Port bug 1433667: Honour system titlebar button left/right placement on Linux. r=darktrojan
authorRichard Marti <richard.marti@gmail.com>
Sat, 19 Jan 2019 17:15:13 +0100
changeset 33404 1b078853f30d
parent 33403 fe3c8a49ad2f
child 33405 2560743a5174
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdarktrojan
bugs1521199, 1433667
Bug 1521199 - Port bug 1433667: Honour system titlebar button left/right placement on Linux. r=darktrojan
mail/base/content/mainNavigationToolbox.inc.xul
mail/base/content/messenger.xul
mail/themes/linux/mail/messenger.css
mail/themes/windows/mail/messenger.css
--- a/mail/base/content/mainNavigationToolbox.inc.xul
+++ b/mail/base/content/mainNavigationToolbox.inc.xul
@@ -974,11 +974,11 @@
 
       <!-- Help -->
 #include helpMenu.inc.xul
 
       <spacer id="menubar_spacer" flex="100%"/>
       </menubar>
     </toolbaritem>
 #ifndef XP_MACOSX
-    <hbox class="titlebar-placeholder" type="caption-buttons" ordinal="1000"/>
+    <hbox class="titlebar-placeholder" type="caption-buttons"/>
 #endif
   </toolbar>
--- a/mail/base/content/messenger.xul
+++ b/mail/base/content/messenger.xul
@@ -410,21 +410,17 @@
                      type="menu"
                      hidden="true"
                      tooltiptext="&listAllTabs.label;">
         <menupopup class="tabs-alltabs-popup"
                    id="alltabs-popup" position="after_end"
                    tabcontainer="tabmail-tabs"/>
       </toolbarbutton>
 
-      <hbox class="titlebar-placeholder" type="caption-buttons"
-#ifndef XP_MACOSX
-            ordinal="1000"
-#endif
-            />
+      <hbox class="titlebar-placeholder" type="caption-buttons"/>
 #ifdef XP_MACOSX
       <hbox class="titlebar-placeholder" type="fullscreen-button"/>
 #endif
     </toolbar>
 
   </toolbox>
 
   <!-- XXX This extension point (tabmail-container) is only temporary!
--- a/mail/themes/linux/mail/messenger.css
+++ b/mail/themes/linux/mail/messenger.css
@@ -199,18 +199,36 @@ toolbar[brighttext] {
     }
   }
   @media (-moz-gtk-csd-close-button: 0) {
     #titlebar-close {
       display: none;
     }
   }
 
-  :root[tabsintitlebar] .titlebar-placeholder[type="caption-buttons"] {
-    margin-inline-start: 10px;
+  @media (-moz-gtk-csd-reversed-placement: 0) {
+    .titlebar-placeholder[type="caption-buttons"] {
+      -moz-box-ordinal-group: 1000;
+    }
+
+    :root[tabsintitlebar] .titlebar-placeholder[type="caption-buttons"] {
+      margin-inline-start: 10px;
+    }
+  }
+
+  @media (-moz-gtk-csd-reversed-placement) {
+    #titlebar-buttonbox-container,
+    #titlebar-close,
+    .titlebar-placeholder[type="caption-buttons"] {
+      -moz-box-ordinal-group: 0;
+    }
+
+    :root[tabsintitlebar] .titlebar-placeholder[type="caption-buttons"] {
+      margin-inline-end: 10px;
+    }
   }
 }
 
 toolbar:not(.inline-toolbar):not(.contentTabToolbar):not(:-moz-lwtheme) {
   -moz-appearance: menubar;
   color: -moz-menubartext;
 }
 
--- a/mail/themes/windows/mail/messenger.css
+++ b/mail/themes/windows/mail/messenger.css
@@ -146,16 +146,20 @@ toolbar[brighttext] {
 .inline-toolbar toolbarseparator {
   height: 24px;
 }
 
 .inline-toolbar toolbarspacer {
   height: 20px;
 }
 
+.titlebar-placeholder[type="caption-buttons"] {
+  -moz-box-ordinal-group: 1000;
+}
+
 /* ::::: menubar ::::: */
 
 #menubar-items {
   -moz-box-orient: vertical; /* for flex hack */
   margin-bottom: 1px;
 }
 
 #menubar-items > menubar {