Bug 1507423 - Don't return border/padding from MOZ_GTK_HEADER_BAR/MOZ_GTK_HEADER_BAR_MAXIMIZED. r=mconley, a=RyanVM
authorMartin Stransky <stransky@redhat.com>
Tue, 18 Dec 2018 10:47:48 +0000
changeset 509140 08d3a2f3dfd435d6ff454791550b0e533ac0c615
parent 509139 1475a44efc760726647c49805b5faa4c2a0141ff
child 509141 c251f26c00d2737f3e0231afbf97123884542a46
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, RyanVM
bugs1507423
milestone65.0
Bug 1507423 - Don't return border/padding from MOZ_GTK_HEADER_BAR/MOZ_GTK_HEADER_BAR_MAXIMIZED. r=mconley, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D14242
widget/gtk/gtk3drawing.cpp
--- a/widget/gtk/gtk3drawing.cpp
+++ b/widget/gtk/gtk3drawing.cpp
@@ -2126,18 +2126,16 @@ static gint moz_gtk_info_bar_paint(cairo
 
 static gint moz_gtk_header_bar_paint(WidgetNodeType widgetType, cairo_t* cr,
                                      GdkRectangle* rect,
                                      GtkWidgetState* state) {
   GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
   GtkStyleContext* style =
       GetStyleContext(widgetType, GTK_TEXT_DIR_NONE, state_flags);
 
-  InsetByMargin(rect, style);
-
 // Some themes (Adwaita for instance) draws bold dark line at
 // titlebar bottom. It does not fit well with Firefox tabs so
 // draw with some extent to make the titlebar bottom part invisible.
 #define TITLEBAR_EXTENT 4
 
   // We don't need to draw window decoration for MOZ_GTK_HEADER_BAR_MAXIMIZED,
   // i.e. when main window is maximized.
   if (widgetType == MOZ_GTK_HEADER_BAR) {
@@ -2341,23 +2339,16 @@ gint moz_gtk_get_widget_border(WidgetNod
       GtkStyleContext* boxStyle = GetStyleContext(MOZ_GTK_TOOLTIP_BOX);
       moz_gtk_add_margin_border_padding(boxStyle, left, top, right, bottom);
 
       GtkStyleContext* labelStyle = GetStyleContext(MOZ_GTK_TOOLTIP_BOX_LABEL);
       moz_gtk_add_margin_border_padding(labelStyle, left, top, right, bottom);
 
       return MOZ_GTK_SUCCESS;
     }
-    case MOZ_GTK_HEADER_BAR:
-    case MOZ_GTK_HEADER_BAR_MAXIMIZED: {
-      style = GetStyleContext(widget);
-      moz_gtk_add_border_padding(style, left, top, right, bottom);
-      *top = *bottom = 0;
-      return MOZ_GTK_SUCCESS;
-    }
     /* These widgets have no borders, since they are not containers. */
     case MOZ_GTK_CHECKBUTTON_LABEL:
     case MOZ_GTK_RADIOBUTTON_LABEL:
     case MOZ_GTK_SPLITTER_HORIZONTAL:
     case MOZ_GTK_SPLITTER_VERTICAL:
     case MOZ_GTK_CHECKBUTTON:
     case MOZ_GTK_RADIOBUTTON:
     case MOZ_GTK_SCROLLBAR_BUTTON:
@@ -2367,16 +2358,18 @@ gint moz_gtk_get_widget_border(WidgetNod
     case MOZ_GTK_SCALE_THUMB_VERTICAL:
     case MOZ_GTK_GRIPPER:
     case MOZ_GTK_PROGRESS_CHUNK:
     case MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE:
     case MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE:
     case MOZ_GTK_TREEVIEW_EXPANDER:
     case MOZ_GTK_TOOLBAR_SEPARATOR:
     case MOZ_GTK_MENUSEPARATOR:
+    case MOZ_GTK_HEADER_BAR:
+    case MOZ_GTK_HEADER_BAR_MAXIMIZED:
     case MOZ_GTK_HEADER_BAR_BUTTON_CLOSE:
     case MOZ_GTK_HEADER_BAR_BUTTON_MINIMIZE:
     case MOZ_GTK_HEADER_BAR_BUTTON_MAXIMIZE:
     case MOZ_GTK_HEADER_BAR_BUTTON_MAXIMIZE_RESTORE:
     /* These widgets have no borders.*/
     case MOZ_GTK_INNER_SPIN_BUTTON:
     case MOZ_GTK_SPINBUTTON:
     case MOZ_GTK_WINDOW: