Bug 1507423 - Don't draw StyleAppearance::MozWindowButtonBox on Linux/Gtk, r=mconley

Depends on D14243

Differential Revision: https://phabricator.services.mozilla.com/D14244

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Martin Stransky 2018-12-18 10:48:28 +00:00
parent 8449b576c3
commit 36e0a3f5a9
2 changed files with 16 additions and 1 deletions

View File

@ -1092,6 +1092,18 @@ bool nsNativeThemeGTK::GetExtraSizeForWidget(nsIFrame* aFrame,
return true;
}
bool
nsNativeThemeGTK::IsWidgetVisible(StyleAppearance aAppearance)
{
switch (aAppearance) {
case StyleAppearance::MozWindowButtonBox:
return false;
default:
break;
}
return true;
}
NS_IMETHODIMP
nsNativeThemeGTK::DrawWidgetBackground(gfxContext* aContext, nsIFrame* aFrame,
StyleAppearance aAppearance,
@ -1101,7 +1113,9 @@ nsNativeThemeGTK::DrawWidgetBackground(gfxContext* aContext, nsIFrame* aFrame,
WidgetNodeType gtkWidgetType;
GtkTextDirection direction = GetTextDirection(aFrame);
gint flags;
if (!GetGtkWidgetAndState(aAppearance, aFrame, gtkWidgetType, &state,
if (!IsWidgetVisible(aAppearance) ||
!GetGtkWidgetAndState(aAppearance, aFrame, gtkWidgetType, &state,
&flags)) {
return NS_OK;
}

View File

@ -90,6 +90,7 @@ class nsNativeThemeGTK final : private nsNativeTheme,
GtkWidgetState* aState, gint* aWidgetFlags);
bool GetExtraSizeForWidget(nsIFrame* aFrame, StyleAppearance aAppearance,
nsIntMargin* aExtra);
bool IsWidgetVisible(StyleAppearance aAppearance);
void RefreshWidgetWindow(nsIFrame* aFrame);
WidgetNodeType NativeThemeToGtkTheme(StyleAppearance aAppearance,