Bug 1346961 draw opaque scrollbar background on outermost scrollbar element even for GTK versions >= 3.20 r=jhorak a=gchang
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 16 Mar 2017 18:02:27 +1300
changeset 395277 cf5d38d16c0aaf590deffe9484207ef432fc6783
parent 395276 9e43e1f59479ffc547a60c19cac4b2808ff2a7ea
child 395278 cfa5921c738463d6a7181c08d6cffee495ea30e8
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjhorak, gchang
bugs1346961
milestone54.0a2
Bug 1346961 draw opaque scrollbar background on outermost scrollbar element even for GTK versions >= 3.20 r=jhorak a=gchang MozReview-Commit-ID: BHsD1h4UQbs
widget/gtk/gtk3drawing.cpp
--- a/widget/gtk/gtk3drawing.cpp
+++ b/widget/gtk/gtk3drawing.cpp
@@ -626,26 +626,18 @@ moz_gtk_draw_styled_frame(GtkStyleContex
                          rect.x, rect.y, rect.width, rect.height);
     }
 }
 
 static gint
 moz_gtk_scrollbar_trough_paint(WidgetNodeType widget,
                                cairo_t *cr, const GdkRectangle* rect,
                                GtkWidgetState* state,
-                               GtkScrollbarTrackFlags flags,
                                GtkTextDirection direction)
 {
-    if (flags & MOZ_GTK_TRACK_OPAQUE) {
-        GtkStyleContext* style = ClaimStyleContext(MOZ_GTK_WINDOW, direction);
-        gtk_render_background(style, cr,
-                              rect->x, rect->y, rect->width, rect->height);
-        ReleaseStyleContext(style);
-    }
-
     GtkStyleContext* style = ClaimStyleContext(widget, direction);
     moz_gtk_draw_styled_frame(style, cr, rect, state->focused);
     ReleaseStyleContext(style);
 
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
@@ -2634,34 +2626,37 @@ moz_gtk_widget_paint(WidgetNodeType widg
         break;
     case MOZ_GTK_SCROLLBAR_BUTTON:
         return moz_gtk_scrollbar_button_paint(cr, rect, state,
                                               (GtkScrollbarButtonFlags) flags,
                                               direction);
         break;
     case MOZ_GTK_SCROLLBAR_HORIZONTAL:
     case MOZ_GTK_SCROLLBAR_VERTICAL:
+        if (flags & MOZ_GTK_TRACK_OPAQUE) {
+            GtkStyleContext* style =
+                ClaimStyleContext(MOZ_GTK_WINDOW, direction);
+            gtk_render_background(style, cr,
+                                  rect->x, rect->y, rect->width, rect->height);
+            ReleaseStyleContext(style);
+        }
         if (gtk_check_version(3,20,0) == nullptr) {
           return moz_gtk_scrollbar_paint(widget, cr, rect, state, direction);
         } else {
           WidgetNodeType trough_widget = (widget == MOZ_GTK_SCROLLBAR_HORIZONTAL) ?
               MOZ_GTK_SCROLLBAR_TROUGH_HORIZONTAL : MOZ_GTK_SCROLLBAR_TROUGH_VERTICAL;
           return moz_gtk_scrollbar_trough_paint(trough_widget, cr, rect,
-                                                state,
-                                                (GtkScrollbarTrackFlags) flags,
-                                                direction);
+                                                state, direction);
         }
         break;
     case MOZ_GTK_SCROLLBAR_TROUGH_HORIZONTAL:
     case MOZ_GTK_SCROLLBAR_TROUGH_VERTICAL:
         if (gtk_check_version(3,20,0) == nullptr) {
           return moz_gtk_scrollbar_trough_paint(widget, cr, rect,
-                                                state,
-                                                (GtkScrollbarTrackFlags) flags,
-                                                direction);
+                                                state, direction);
         }
         break;
     case MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL:
     case MOZ_GTK_SCROLLBAR_THUMB_VERTICAL:
         return moz_gtk_scrollbar_thumb_paint(widget, cr, rect,
                                              state, direction);
         break;
     case MOZ_GTK_SCALE_HORIZONTAL: