summaryrefslogtreecommitdiffstats
path: root/widget/gtk
diff options
context:
space:
mode:
authortrav90 <travawine@protonmail.ch>2018-04-05 15:46:38 -0500
committertrav90 <travawine@protonmail.ch>2018-04-05 15:46:38 -0500
commit9fed5c8f398721fa1cf2fe9e28ead8ccd94d569f (patch)
tree234ed3124677dd5bfc6e8204f994e2bcf9da7d86 /widget/gtk
parentd960419686462067cb5745dcd1ad264abe0b1485 (diff)
downloadUXP-9fed5c8f398721fa1cf2fe9e28ead8ccd94d569f.tar
UXP-9fed5c8f398721fa1cf2fe9e28ead8ccd94d569f.tar.gz
UXP-9fed5c8f398721fa1cf2fe9e28ead8ccd94d569f.tar.lz
UXP-9fed5c8f398721fa1cf2fe9e28ead8ccd94d569f.tar.xz
UXP-9fed5c8f398721fa1cf2fe9e28ead8ccd94d569f.zip
[GTK3] Draw menuitem background even when not in hover
Diffstat (limited to 'widget/gtk')
-rw-r--r--widget/gtk/gtk3drawing.cpp44
1 files changed, 20 insertions, 24 deletions
diff --git a/widget/gtk/gtk3drawing.cpp b/widget/gtk/gtk3drawing.cpp
index fb95b4cc4..b9e26c3cc 100644
--- a/widget/gtk/gtk3drawing.cpp
+++ b/widget/gtk/gtk3drawing.cpp
@@ -1826,35 +1826,31 @@ moz_gtk_menu_item_paint(WidgetNodeType widget, cairo_t *cr, GdkRectangle* rect,
{
gint x, y, w, h;
- if (state->inHover && !state->disabled) {
- GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
- GtkStyleContext* style =
- ClaimStyleContext(widget, direction, state_flags);
-
- bool pre_3_6 = gtk_check_version(3, 6, 0) != nullptr;
- if (pre_3_6) {
- // GTK+ 3.4 saves the style context and adds the menubar class to
- // menubar children, but does each of these only when drawing, not
- // during layout.
- gtk_style_context_save(style);
- if (widget == MOZ_GTK_MENUBARITEM) {
- gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUBAR);
- }
+ GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
+ GtkStyleContext* style = ClaimStyleContext(widget, direction, state_flags);
+
+ bool pre_3_6 = gtk_check_version(3, 6, 0) != nullptr;
+ if (pre_3_6) {
+ // GTK+ 3.4 saves the style context and adds the menubar class to
+ // menubar children, but does each of these only when drawing, not
+ // during layout.
+ gtk_style_context_save(style);
+ if (widget == MOZ_GTK_MENUBARITEM) {
+ gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUBAR);
}
- x = rect->x;
- y = rect->y;
- w = rect->width;
- h = rect->height;
+ x = rect->x;
+ y = rect->y;
+ w = rect->width;
+ h = rect->height;
- gtk_render_background(style, cr, x, y, w, h);
- gtk_render_frame(style, cr, x, y, w, h);
+ gtk_render_background(style, cr, x, y, w, h);
+ gtk_render_frame(style, cr, x, y, w, h);
- if (pre_3_6) {
- gtk_style_context_restore(style);
- }
- ReleaseStyleContext(style);
+ if (pre_3_6) {
+ gtk_style_context_restore(style);
}
+ ReleaseStyleContext(style);
return MOZ_GTK_SUCCESS;
}