diff --git a/widget/gtk/WidgetStyleCache.cpp b/widget/gtk/WidgetStyleCache.cpp index c5bfbd55b900..41c5111e319c 100644 --- a/widget/gtk/WidgetStyleCache.cpp +++ b/widget/gtk/WidgetStyleCache.cpp @@ -555,6 +555,14 @@ CreateHeaderBar(WidgetNodeType aWidgetType) // Emulate what create_titlebar() at gtkwindow.c does. GtkStyleContext* style = gtk_widget_get_style_context(headerbar); gtk_style_context_add_class(style, "titlebar"); + + // TODO: Define default-decoration titlebar style as workaround + // to ensure the titlebar buttons does not overflow outside. + // Recently the titlebar size is calculated as + // tab size + titlebar border/padding (default-decoration has 6px padding + // at default Adwaita theme). + // We need to fix titlebar size calculation to also include + // titlebar button sizes. (Bug 1419442) gtk_style_context_add_class(style, "default-decoration"); return headerbar; diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp index cc40f77b69b0..c82f25650f8d 100644 --- a/widget/gtk/nsNativeThemeGTK.cpp +++ b/widget/gtk/nsNativeThemeGTK.cpp @@ -1575,6 +1575,16 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext, *aIsOverridable = false; } break; + case NS_THEME_WINDOW_BUTTON_CLOSE: + case NS_THEME_WINDOW_BUTTON_MINIMIZE: + case NS_THEME_WINDOW_BUTTON_MAXIMIZE: + case NS_THEME_WINDOW_BUTTON_RESTORE: + { + const ToolbarButtonGTKMetrics* metrics = GetToolbarButtonMetrics(); + aResult->width = metrics->minSizeWithBorderMargin.width; + aResult->height = metrics->minSizeWithBorderMargin.height; + break; + } case NS_THEME_CHECKBOX_CONTAINER: case NS_THEME_RADIO_CONTAINER: case NS_THEME_CHECKBOX_LABEL: @@ -1583,10 +1593,6 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext, case NS_THEME_MENULIST: case NS_THEME_TOOLBARBUTTON: case NS_THEME_TREEHEADERCELL: - case NS_THEME_WINDOW_BUTTON_CLOSE: - case NS_THEME_WINDOW_BUTTON_MINIMIZE: - case NS_THEME_WINDOW_BUTTON_MAXIMIZE: - case NS_THEME_WINDOW_BUTTON_RESTORE: { if (aWidgetType == NS_THEME_MENULIST) { // Include the arrow size.