diff --git a/widget/gtk/gtk3drawing.cpp b/widget/gtk/gtk3drawing.cpp index 6702ff95c8c1..2a481d70b587 100644 --- a/widget/gtk/gtk3drawing.cpp +++ b/widget/gtk/gtk3drawing.cpp @@ -2644,10 +2644,11 @@ GetScrollbarMetrics(GtkOrientation aOrientation) // button if (hasButtons) { metrics->size.button = GetMinMarginBox(MOZ_GTK_SCROLLBAR_BUTTON); - // If the buttons will cause Gecko to expand the track to fill - // available breadth, then add to the track border to prevent Gecko - // from expanding the thumb to fill available breadth. if (aOrientation == GTK_ORIENTATION_HORIZONTAL) { + metrics->size.button.Rotate(); + // If the buttons will cause Gecko to expand the track to fill + // available breadth, then add to the track border to prevent Gecko + // from expanding the thumb to fill available breadth. gint extra = metrics->size.button.height - trackSizeForThumb.height; if (extra > 0) { // If extra is odd, then the thumb is 0.5 pixels above diff --git a/widget/gtk/gtkdrawing.h b/widget/gtk/gtkdrawing.h index 1d9142c91b4b..521ed05e09c7 100644 --- a/widget/gtk/gtkdrawing.h +++ b/widget/gtk/gtkdrawing.h @@ -52,6 +52,12 @@ struct MozGtkSize { gint resultHeight = height + aBorder.top + aBorder.bottom; return {resultWidth, resultHeight}; } + void Rotate() + { + gint tmp = width; + width = height; + height = tmp; + } }; typedef struct {