Updated Gtk3.20 patch - fixed tooltips

This commit is contained in:
Martin Stransky 2016-05-20 15:13:45 +02:00
parent f120b507ec
commit 9b41f1108b
2 changed files with 193 additions and 107 deletions

View File

@ -1,7 +1,7 @@
diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/gtk3drawing.c diff -up firefox-46.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0.1/widget/gtk/gtk3drawing.c
--- firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 2016-04-22 02:37:27.000000000 +0200 --- firefox-46.0.1/widget/gtk/gtk3drawing.c.gtk3-20 2016-05-03 07:31:12.000000000 +0200
+++ firefox-46.0/widget/gtk/gtk3drawing.c 2016-04-25 14:56:19.006992927 +0200 +++ firefox-46.0.1/widget/gtk/gtk3drawing.c 2016-05-20 15:05:08.750151522 +0200
@@ -17,32 +17,79 @@ @@ -17,34 +17,86 @@
#include <math.h> #include <math.h>
@ -22,6 +22,11 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
+ +
+ struct { + struct {
+ GtkStyleContext* style; + GtkStyleContext* style;
+ GtkStyleContext* styleBackground;
+ } tooltip;
+
+ struct {
+ GtkStyleContext* style;
+ GtkStyleContext* styleContents; + GtkStyleContext* styleContents;
+ GtkStyleContext* styleTrough; + GtkStyleContext* styleTrough;
+ GtkStyleContext* styleSlider; + GtkStyleContext* styleSlider;
@ -88,9 +93,12 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
-static GtkWidget* gProgressWidget; -static GtkWidget* gProgressWidget;
+static MozGtkWidget gProgressBar; +static MozGtkWidget gProgressBar;
static GtkWidget* gTabWidget; static GtkWidget* gTabWidget;
static GtkWidget* gTooltipWidget; -static GtkWidget* gTooltipWidget;
+static MozGtkWidget gTooltip;
static GtkWidget* gMenuBarWidget; static GtkWidget* gMenuBarWidget;
@@ -78,6 +125,37 @@ static gboolean is_initialized; static GtkWidget* gMenuBarItemWidget;
static GtkWidget* gMenuPopupWidget;
@@ -78,6 +130,37 @@ static gboolean is_initialized;
#define GTK_STATE_FLAG_CHECKED (1 << 11) #define GTK_STATE_FLAG_CHECKED (1 << 11)
#endif #endif
@ -128,7 +136,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
static GtkStateFlags static GtkStateFlags
GetStateFlagsFromGtkWidgetState(GtkWidgetState* state) GetStateFlagsFromGtkWidgetState(GtkWidgetState* state)
{ {
@@ -97,6 +175,41 @@ GetStateFlagsFromGtkWidgetState(GtkWidge @@ -97,6 +180,41 @@ GetStateFlagsFromGtkWidgetState(GtkWidge
return stateFlags; return stateFlags;
} }
@ -170,7 +178,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
/* Because we have such an unconventional way of drawing widgets, signal to the GTK theme engine /* Because we have such an unconventional way of drawing widgets, signal to the GTK theme engine
that they are drawing for Mozilla instead of a conventional GTK app so they can do any specific that they are drawing for Mozilla instead of a conventional GTK app so they can do any specific
things they may want to do. */ things they may want to do. */
@@ -141,9 +254,16 @@ setup_widget_prototype(GtkWidget* widget @@ -141,9 +259,16 @@ setup_widget_prototype(GtkWidget* widget
static gint static gint
ensure_button_widget() ensure_button_widget()
{ {
@ -190,7 +198,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
} }
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -195,9 +315,21 @@ ensure_button_arrow_widget() @@ -195,9 +320,21 @@ ensure_button_arrow_widget()
static gint static gint
ensure_checkbox_widget() ensure_checkbox_widget()
{ {
@ -215,7 +223,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
} }
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -205,9 +337,21 @@ ensure_checkbox_widget() @@ -205,9 +342,21 @@ ensure_checkbox_widget()
static gint static gint
ensure_radiobutton_widget() ensure_radiobutton_widget()
{ {
@ -240,7 +248,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
} }
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -215,25 +359,62 @@ ensure_radiobutton_widget() @@ -215,25 +364,62 @@ ensure_radiobutton_widget()
static gint static gint
ensure_scrollbar_widget() ensure_scrollbar_widget()
{ {
@ -316,7 +324,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
} }
static gint static gint
@@ -253,9 +434,19 @@ ensure_scale_widget() @@ -253,9 +439,19 @@ ensure_scale_widget()
static gint static gint
ensure_entry_widget() ensure_entry_widget()
{ {
@ -339,7 +347,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
} }
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -387,9 +578,9 @@ moz_gtk_get_combo_box_entry_inner_widget @@ -387,9 +583,9 @@ moz_gtk_get_combo_box_entry_inner_widget
g_object_add_weak_pointer(G_OBJECT(widget), g_object_add_weak_pointer(G_OBJECT(widget),
(gpointer) &gComboBoxEntryButtonWidget); (gpointer) &gComboBoxEntryButtonWidget);
} else if (GTK_IS_ENTRY(widget)) { } else if (GTK_IS_ENTRY(widget)) {
@ -351,7 +359,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
} else } else
return; return;
gtk_widget_realize(widget); gtk_widget_realize(widget);
@@ -411,7 +602,7 @@ ensure_combo_box_entry_widgets() @@ -411,7 +607,7 @@ ensure_combo_box_entry_widgets()
{ {
GtkWidget* buttonChild; GtkWidget* buttonChild;
@ -360,7 +368,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
gComboBoxEntryButtonWidget && gComboBoxEntryButtonWidget &&
gComboBoxEntryArrowWidget) gComboBoxEntryArrowWidget)
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
@@ -427,9 +618,9 @@ ensure_combo_box_entry_widgets() @@ -427,9 +623,9 @@ ensure_combo_box_entry_widgets()
moz_gtk_get_combo_box_entry_inner_widgets, moz_gtk_get_combo_box_entry_inner_widgets,
NULL); NULL);
@ -372,7 +380,32 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
} }
if (gComboBoxEntryButtonWidget) { if (gComboBoxEntryButtonWidget) {
@@ -530,9 +721,21 @@ ensure_tab_widget() @@ -507,12 +703,18 @@ ensure_toolbar_separator_widget()
static gint
ensure_tooltip_widget()
{
- if (!gTooltipWidget) {
- gTooltipWidget = gtk_window_new(GTK_WINDOW_POPUP);
- GtkStyleContext* style = gtk_widget_get_style_context(gTooltipWidget);
- gtk_style_context_add_class(style, GTK_STYLE_CLASS_TOOLTIP);
- gtk_widget_realize(gTooltipWidget);
- moz_gtk_set_widget_name(gTooltipWidget);
+ if (!gTooltip.widget) {
+ GtkCssNode path[] = {
+ { GTK_TYPE_TOOLTIP, "tooltip", NULL, NULL},
+ { GTK_TYPE_TOOLTIP, "tooltip", "background", NULL},
+ };
+
+ gTooltip.widget = gtk_window_new(GTK_WINDOW_POPUP);
+ gtk_widget_realize(gTooltip.widget);
+ moz_gtk_set_widget_name(gTooltip.widget);
+
+ gTooltip.tooltip.style = moz_gtk_style_create(&path[0], NULL);
+ gTooltip.tooltip.styleBackground = moz_gtk_style_create(&path[1], NULL);
}
return MOZ_GTK_SUCCESS;
}
@@ -530,9 +732,21 @@ ensure_tab_widget()
static gint static gint
ensure_progress_widget() ensure_progress_widget()
{ {
@ -397,7 +430,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
} }
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -638,6 +841,11 @@ static gint @@ -638,6 +852,11 @@ static gint
ensure_check_menu_item_widget() ensure_check_menu_item_widget()
{ {
if (!gCheckMenuItemWidget) { if (!gCheckMenuItemWidget) {
@ -409,7 +442,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
ensure_menu_popup_widget(); ensure_menu_popup_widget();
gCheckMenuItemWidget = gtk_check_menu_item_new_with_label("M"); gCheckMenuItemWidget = gtk_check_menu_item_new_with_label("M");
gtk_menu_shell_append(GTK_MENU_SHELL(gMenuPopupWidget), gtk_menu_shell_append(GTK_MENU_SHELL(gMenuPopupWidget),
@@ -752,7 +960,7 @@ moz_gtk_checkbox_get_metrics(gint* indic @@ -752,7 +971,7 @@ moz_gtk_checkbox_get_metrics(gint* indic
{ {
ensure_checkbox_widget(); ensure_checkbox_widget();
@ -418,7 +451,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
"indicator_size", indicator_size, "indicator_size", indicator_size,
"indicator_spacing", indicator_spacing, "indicator_spacing", indicator_spacing,
NULL); NULL);
@@ -765,7 +973,7 @@ moz_gtk_radio_get_metrics(gint* indicato @@ -765,7 +984,7 @@ moz_gtk_radio_get_metrics(gint* indicato
{ {
ensure_radiobutton_widget(); ensure_radiobutton_widget();
@ -427,24 +460,25 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
"indicator_size", indicator_size, "indicator_size", indicator_size,
"indicator_spacing", indicator_spacing, "indicator_spacing", indicator_spacing,
NULL); NULL);
@@ -778,13 +986,12 @@ moz_gtk_get_focus_outline_size(gint* foc @@ -778,13 +997,13 @@ moz_gtk_get_focus_outline_size(gint* foc
{ {
GtkBorder border; GtkBorder border;
GtkBorder padding; GtkBorder padding;
- GtkStyleContext *style; - GtkStyleContext *style;
+ GtkStyleContext* style = gEntry.entry.style; + GtkStyleContext* style;
ensure_entry_widget(); ensure_entry_widget();
- style = gtk_widget_get_style_context(gEntryWidget); - style = gtk_widget_get_style_context(gEntryWidget);
- gtk_style_context_get_border(style, 0, &border); - gtk_style_context_get_border(style, 0, &border);
- gtk_style_context_get_padding(style, 0, &padding); - gtk_style_context_get_padding(style, 0, &padding);
+ GtkStyleContext* style = gEntry.entry.style;
+ gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); + gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border);
+ gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); + gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding);
*focus_h_width = border.left + padding.left; *focus_h_width = border.left + padding.left;
*focus_v_width = border.top + padding.top; *focus_v_width = border.top + padding.top;
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
@@ -821,7 +1028,7 @@ moz_gtk_button_get_default_overflow(gint @@ -821,7 +1040,7 @@ moz_gtk_button_get_default_overflow(gint
GtkBorder* default_outside_border; GtkBorder* default_outside_border;
ensure_button_widget(); ensure_button_widget();
@ -453,7 +487,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
"default-outside-border", &default_outside_border, "default-outside-border", &default_outside_border,
NULL); NULL);
@@ -844,7 +1051,7 @@ moz_gtk_button_get_default_border(gint* @@ -844,7 +1063,7 @@ moz_gtk_button_get_default_border(gint*
GtkBorder* default_border; GtkBorder* default_border;
ensure_button_widget(); ensure_button_widget();
@ -462,7 +496,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
"default-border", &default_border, "default-border", &default_border,
NULL); NULL);
@@ -935,7 +1142,7 @@ moz_gtk_button_paint(cairo_t *cr, GdkRec @@ -935,7 +1154,7 @@ moz_gtk_button_paint(cairo_t *cr, GdkRec
if (state->focused) { if (state->focused) {
GtkBorder border; GtkBorder border;
@ -471,7 +505,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
x += border.left; x += border.left;
y += border.top; y += border.top;
width -= (border.left + border.right); width -= (border.left + border.right);
@@ -956,15 +1163,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec @@ -956,15 +1175,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec
gint indicator_size, indicator_spacing; gint indicator_size, indicator_spacing;
gint x, y, width, height; gint x, y, width, height;
gint focus_x, focus_y, focus_width, focus_height; gint focus_x, focus_y, focus_width, focus_height;
@ -490,7 +524,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
} }
// XXX we should assert rect->height >= indicator_size too // XXX we should assert rect->height >= indicator_size too
@@ -983,11 +1189,9 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec @@ -983,11 +1201,9 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec
focus_width = width + 2 * indicator_spacing; focus_width = width + 2 * indicator_spacing;
focus_height = height + 2 * indicator_spacing; focus_height = height + 2 * indicator_spacing;
@ -505,7 +539,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
if (selected) if (selected)
state_flags |= checkbox_check_state; state_flags |= checkbox_check_state;
@@ -995,13 +1199,15 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec @@ -995,13 +1211,15 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec
if (inconsistent) if (inconsistent)
state_flags |= GTK_STATE_FLAG_INCONSISTENT; state_flags |= GTK_STATE_FLAG_INCONSISTENT;
@ -525,7 +559,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
focus_width, focus_height); focus_width, focus_height);
} }
} }
@@ -1010,15 +1216,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec @@ -1010,15 +1228,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec
* 'indeterminate' type on checkboxes. In GTK, the shadow type * 'indeterminate' type on checkboxes. In GTK, the shadow type
* must also be changed for the state to be drawn. * must also be changed for the state to be drawn.
*/ */
@ -545,7 +579,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -1035,8 +1240,8 @@ calculate_button_inner_rect(GtkWidget* b @@ -1035,8 +1252,8 @@ calculate_button_inner_rect(GtkWidget* b
style = gtk_widget_get_style_context(button); style = gtk_widget_get_style_context(button);
/* This mirrors gtkbutton's child positioning */ /* This mirrors gtkbutton's child positioning */
@ -556,7 +590,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
inner_rect->x = rect->x + border.left + padding.left; inner_rect->x = rect->x + border.left + padding.left;
inner_rect->y = rect->y + padding.top + border.top; inner_rect->y = rect->y + padding.top + border.top;
@@ -1099,9 +1304,9 @@ moz_gtk_scrollbar_button_paint(cairo_t * @@ -1099,9 +1316,9 @@ moz_gtk_scrollbar_button_paint(cairo_t *
ensure_scrollbar_widget(); ensure_scrollbar_widget();
if (flags & MOZ_GTK_STEPPER_VERTICAL) if (flags & MOZ_GTK_STEPPER_VERTICAL)
@ -568,7 +602,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
gtk_widget_set_direction(scrollbar, direction); gtk_widget_set_direction(scrollbar, direction);
@@ -1181,25 +1386,22 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW @@ -1181,25 +1398,22 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW
GtkTextDirection direction) GtkTextDirection direction)
{ {
GtkStyleContext* style; GtkStyleContext* style;
@ -602,7 +636,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height); gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
@@ -1208,7 +1410,6 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW @@ -1208,7 +1422,6 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW
gtk_render_focus(style, cr, gtk_render_focus(style, cr,
rect->x, rect->y, rect->width, rect->height); rect->x, rect->y, rect->width, rect->height);
} }
@ -610,7 +644,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -1220,24 +1421,20 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi @@ -1220,24 +1433,20 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi
{ {
GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
GtkStyleContext* style; GtkStyleContext* style;
@ -643,7 +677,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
gtk_style_context_get_margin (style, state_flags, &margin); gtk_style_context_get_margin (style, state_flags, &margin);
gtk_render_slider(style, cr, gtk_render_slider(style, cr,
@@ -1248,8 +1445,6 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi @@ -1248,8 +1457,6 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi
(widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL) ? (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL) ?
GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL); GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL);
@ -652,7 +686,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -1260,8 +1455,8 @@ moz_gtk_spin_paint(cairo_t *cr, GdkRecta @@ -1260,8 +1467,8 @@ moz_gtk_spin_paint(cairo_t *cr, GdkRecta
GtkStyleContext* style; GtkStyleContext* style;
ensure_spin_widget(); ensure_spin_widget();
@ -663,7 +697,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
gtk_style_context_save(style); gtk_style_context_save(style);
gtk_style_context_add_class(style, GTK_STYLE_CLASS_SPINBUTTON); gtk_style_context_add_class(style, GTK_STYLE_CLASS_SPINBUTTON);
gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
@@ -1280,11 +1475,10 @@ moz_gtk_spin_updown_paint(cairo_t *cr, G @@ -1280,11 +1487,10 @@ moz_gtk_spin_updown_paint(cairo_t *cr, G
GtkStyleContext* style; GtkStyleContext* style;
ensure_spin_widget(); ensure_spin_widget();
@ -677,7 +711,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height); gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
@@ -1450,15 +1644,13 @@ moz_gtk_vpaned_paint(cairo_t *cr, GdkRec @@ -1450,15 +1656,13 @@ moz_gtk_vpaned_paint(cairo_t *cr, GdkRec
static gint static gint
moz_gtk_entry_paint(cairo_t *cr, GdkRectangle* rect, moz_gtk_entry_paint(cairo_t *cr, GdkRectangle* rect,
GtkWidgetState* state, GtkWidgetState* state,
@ -696,7 +730,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
if (draw_focus_outline_only) { if (draw_focus_outline_only) {
// Inflate the given 'rect' with the focus outline size. // Inflate the given 'rect' with the focus outline size.
@@ -1478,10 +1670,9 @@ moz_gtk_entry_paint(cairo_t *cr, GdkRect @@ -1478,10 +1682,9 @@ moz_gtk_entry_paint(cairo_t *cr, GdkRect
* textarea window uses gtk_paint_flat_box when exposed */ * textarea window uses gtk_paint_flat_box when exposed */
/* This gets us a lovely greyish disabledish look */ /* This gets us a lovely greyish disabledish look */
@ -708,7 +742,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
/* Now paint the shadow and focus border. /* Now paint the shadow and focus border.
* We do like in gtk_entry_draw_frame, we first draw the shadow, a tad * We do like in gtk_entry_draw_frame, we first draw the shadow, a tad
@@ -1531,7 +1722,7 @@ moz_gtk_treeview_paint(cairo_t *cr, GdkR @@ -1531,7 +1734,7 @@ moz_gtk_treeview_paint(cairo_t *cr, GdkR
style = gtk_widget_get_style_context(gScrolledWindowWidget); style = gtk_widget_get_style_context(gScrolledWindowWidget);
gtk_style_context_save(style); gtk_style_context_save(style);
gtk_style_context_add_class(style, GTK_STYLE_CLASS_FRAME); gtk_style_context_add_class(style, GTK_STYLE_CLASS_FRAME);
@ -717,7 +751,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
xthickness = border.left; xthickness = border.left;
ythickness = border.top; ythickness = border.top;
@@ -1702,7 +1893,7 @@ moz_gtk_combo_box_paint(cairo_t *cr, Gdk @@ -1702,7 +1905,7 @@ moz_gtk_combo_box_paint(cairo_t *cr, Gdk
if (direction == GTK_TEXT_DIR_LTR) { if (direction == GTK_TEXT_DIR_LTR) {
GtkBorder padding; GtkBorder padding;
GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
@ -726,7 +760,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
arrow_rect.x -= padding.left; arrow_rect.x -= padding.left;
} }
else else
@@ -1804,29 +1995,27 @@ moz_gtk_container_paint(cairo_t *cr, Gdk @@ -1804,29 +2007,27 @@ moz_gtk_container_paint(cairo_t *cr, Gdk
gboolean isradio, GtkTextDirection direction) gboolean isradio, GtkTextDirection direction)
{ {
GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
@ -764,7 +798,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -1836,32 +2025,26 @@ moz_gtk_toggle_label_paint(cairo_t *cr, @@ -1836,32 +2037,26 @@ moz_gtk_toggle_label_paint(cairo_t *cr,
GtkWidgetState* state, GtkWidgetState* state,
gboolean isradio, GtkTextDirection direction) gboolean isradio, GtkTextDirection direction)
{ {
@ -782,15 +816,15 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
} else { } else {
ensure_checkbox_widget(); ensure_checkbox_widget();
- widget = gCheckboxWidget; - widget = gCheckboxWidget;
+ widget = &gCheckbox; - }
}
- style = gtk_widget_get_style_context(widget); - style = gtk_widget_get_style_context(widget);
- gtk_style_context_save(style); - gtk_style_context_save(style);
- if (isradio) { - if (isradio) {
- gtk_style_context_add_class(style, GTK_STYLE_CLASS_RADIO); - gtk_style_context_add_class(style, GTK_STYLE_CLASS_RADIO);
- } else { - } else {
- gtk_style_context_add_class(style, GTK_STYLE_CLASS_CHECK); - gtk_style_context_add_class(style, GTK_STYLE_CLASS_CHECK);
- } + widget = &gCheckbox;
}
- gtk_widget_set_direction(widget, direction); - gtk_widget_set_direction(widget, direction);
+ gtk_style_context_save(widget->check.styleLabel); + gtk_style_context_save(widget->check.styleLabel);
+ gtk_widget_set_direction(widget->widget, direction); + gtk_widget_set_direction(widget->widget, direction);
@ -806,7 +840,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -1922,7 +2105,7 @@ moz_gtk_toolbar_separator_paint(cairo_t @@ -1922,7 +2117,7 @@ moz_gtk_toolbar_separator_paint(cairo_t
rect->height * (end_fraction - start_fraction)); rect->height * (end_fraction - start_fraction));
} else { } else {
GtkBorder padding; GtkBorder padding;
@ -815,7 +849,19 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
paint_width = padding.left; paint_width = padding.left;
if (paint_width > rect->width) if (paint_width > rect->width)
@@ -2006,18 +2189,13 @@ static gint @@ -1945,9 +2140,9 @@ moz_gtk_tooltip_paint(cairo_t *cr, GdkRe
GtkStyleContext* style;
ensure_tooltip_widget();
- gtk_widget_set_direction(gTooltipWidget, direction);
+ gtk_widget_set_direction(gTooltip.widget, direction);
- style = gtk_widget_get_style_context(gTooltipWidget);
+ style = gTooltip.tooltip.styleBackground;
gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
return MOZ_GTK_SUCCESS;
@@ -2006,18 +2201,13 @@ static gint
moz_gtk_progressbar_paint(cairo_t *cr, GdkRectangle* rect, moz_gtk_progressbar_paint(cairo_t *cr, GdkRectangle* rect,
GtkTextDirection direction) GtkTextDirection direction)
{ {
@ -839,7 +885,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -2027,15 +2205,8 @@ moz_gtk_progress_chunk_paint(cairo_t *cr @@ -2027,15 +2217,8 @@ moz_gtk_progress_chunk_paint(cairo_t *cr
GtkTextDirection direction, GtkTextDirection direction,
GtkThemeWidgetType widget) GtkThemeWidgetType widget)
{ {
@ -856,7 +902,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
if (widget == MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE || if (widget == MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE ||
widget == MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE) { widget == MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE) {
@@ -2074,12 +2245,14 @@ moz_gtk_progress_chunk_paint(cairo_t *cr @@ -2074,12 +2257,14 @@ moz_gtk_progress_chunk_paint(cairo_t *cr
// gtk_render_activity was used to render progress chunks on GTK versions // gtk_render_activity was used to render progress chunks on GTK versions
// before 3.13.7, see bug 1173907. // before 3.13.7, see bug 1173907.
if (!gtk_check_version(3, 13, 7)) { if (!gtk_check_version(3, 13, 7)) {
@ -875,7 +921,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -2096,7 +2269,7 @@ moz_gtk_get_tab_thickness(void) @@ -2096,7 +2281,7 @@ moz_gtk_get_tab_thickness(void)
style = gtk_widget_get_style_context(gTabWidget); style = gtk_widget_get_style_context(gTabWidget);
gtk_style_context_add_class(style, GTK_STYLE_CLASS_NOTEBOOK); gtk_style_context_add_class(style, GTK_STYLE_CLASS_NOTEBOOK);
@ -884,7 +930,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
if (border.top < 2) if (border.top < 2)
return 2; /* some themes don't set ythickness correctly */ return 2; /* some themes don't set ythickness correctly */
@@ -2292,7 +2465,7 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectan @@ -2292,7 +2477,7 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectan
gtk_style_context_save(style); gtk_style_context_save(style);
moz_gtk_tab_prepare_style_context(style, flags); moz_gtk_tab_prepare_style_context(style, flags);
@ -893,7 +939,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
focusRect.x += padding.left; focusRect.x += padding.left;
focusRect.width -= (padding.left + padding.right); focusRect.width -= (padding.left + padding.right);
@@ -2408,7 +2581,7 @@ moz_gtk_tab_scroll_arrow_paint(cairo_t * @@ -2408,7 +2593,7 @@ moz_gtk_tab_scroll_arrow_paint(cairo_t *
} }
static gint static gint
@ -902,7 +948,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
GtkTextDirection direction) GtkTextDirection direction)
{ {
GtkStyleContext* style; GtkStyleContext* style;
@@ -2468,7 +2641,7 @@ moz_gtk_menu_separator_paint(cairo_t *cr @@ -2468,7 +2653,7 @@ moz_gtk_menu_separator_paint(cairo_t *cr
border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget)); border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget));
style = gtk_widget_get_style_context(gMenuSeparatorWidget); style = gtk_widget_get_style_context(gMenuSeparatorWidget);
@ -911,7 +957,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
x = rect->x + border_width; x = rect->x + border_width;
y = rect->y + border_width; y = rect->y + border_width;
@@ -2521,7 +2694,8 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk @@ -2521,7 +2706,8 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk
item_widget = gMenuItemWidget; item_widget = gMenuItemWidget;
} }
style = gtk_widget_get_style_context(item_widget); style = gtk_widget_get_style_context(item_widget);
@ -921,7 +967,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
if (flags & MOZ_TOPLEVEL_MENU_ITEM) { if (flags & MOZ_TOPLEVEL_MENU_ITEM) {
gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUBAR); gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUBAR);
@@ -2540,7 +2714,7 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk @@ -2540,7 +2726,7 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk
gtk_render_background(style, cr, x, y, w, h); gtk_render_background(style, cr, x, y, w, h);
gtk_render_frame(style, cr, x, y, w, h); gtk_render_frame(style, cr, x, y, w, h);
@ -930,7 +976,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
} }
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
@@ -2556,7 +2730,10 @@ moz_gtk_menu_arrow_paint(cairo_t *cr, Gd @@ -2556,7 +2742,10 @@ moz_gtk_menu_arrow_paint(cairo_t *cr, Gd
ensure_menu_item_widget(); ensure_menu_item_widget();
gtk_widget_set_direction(gMenuItemWidget, direction); gtk_widget_set_direction(gMenuItemWidget, direction);
@ -942,7 +988,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
style = gtk_widget_get_style_context(gMenuItemWidget); style = gtk_widget_get_style_context(gMenuItemWidget);
gtk_style_context_save(style); gtk_style_context_save(style);
gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUITEM); gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUITEM);
@@ -2606,7 +2783,7 @@ moz_gtk_check_menu_item_paint(cairo_t *c @@ -2606,7 +2795,7 @@ moz_gtk_check_menu_item_paint(cairo_t *c
} }
gtk_style_context_set_state(style, state_flags); gtk_style_context_set_state(style, state_flags);
@ -951,7 +997,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
offset = gtk_container_get_border_width(GTK_CONTAINER(gCheckMenuItemWidget)) + offset = gtk_container_get_border_width(GTK_CONTAINER(gCheckMenuItemWidget)) +
padding.left + 2; padding.left + 2;
@@ -2658,7 +2835,7 @@ moz_gtk_add_style_border(GtkStyleContext @@ -2658,7 +2847,7 @@ moz_gtk_add_style_border(GtkStyleContext
{ {
GtkBorder border; GtkBorder border;
@ -960,7 +1006,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
*left += border.left; *left += border.left;
*right += border.right; *right += border.right;
@@ -2667,12 +2844,22 @@ moz_gtk_add_style_border(GtkStyleContext @@ -2667,12 +2856,22 @@ moz_gtk_add_style_border(GtkStyleContext
} }
static void static void
@ -984,7 +1030,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
*left += padding.left; *left += padding.left;
*right += padding.right; *right += padding.right;
@@ -2680,6 +2867,16 @@ moz_gtk_add_style_padding(GtkStyleContex @@ -2680,6 +2879,16 @@ moz_gtk_add_style_padding(GtkStyleContex
*bottom += padding.bottom; *bottom += padding.bottom;
} }
@ -1001,7 +1047,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
gint gint
moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top, moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
gint* right, gint* bottom, GtkTextDirection direction, gint* right, gint* bottom, GtkTextDirection direction,
@@ -2694,36 +2891,27 @@ moz_gtk_get_widget_border(GtkThemeWidget @@ -2694,37 +2903,35 @@ moz_gtk_get_widget_border(GtkThemeWidget
case MOZ_GTK_TOOLBAR_BUTTON: case MOZ_GTK_TOOLBAR_BUTTON:
{ {
ensure_button_widget(); ensure_button_widget();
@ -1039,13 +1085,21 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
*left = *top = *right = *bottom = -1; *left = *top = *right = *bottom = -1;
- moz_gtk_add_style_padding(style, left, top, right, bottom); - moz_gtk_add_style_padding(style, left, top, right, bottom);
- moz_gtk_add_style_border(style, left, top, right, bottom); - moz_gtk_add_style_border(style, left, top, right, bottom);
+
+ moz_gtk_add_style_padding(gEntry.entry.style, left, top, right, bottom); + moz_gtk_add_style_padding(gEntry.entry.style, left, top, right, bottom);
+ moz_gtk_add_style_border(gEntry.entry.style, left, top, right, bottom); + moz_gtk_add_style_border(gEntry.entry.style, left, top, right, bottom);
+
+ return MOZ_GTK_SUCCESS;
+ }
+ case MOZ_GTK_TOOLTIP:
+ {
+ ensure_tooltip_widget();
+ moz_gtk_add_style_padding(gTooltip.tooltip.styleBackground, left, top, right, bottom);
+ moz_gtk_add_style_border(gTooltip.tooltip.styleBackground, left, top, right, bottom);
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -2759,7 +2947,7 @@ moz_gtk_get_widget_border(GtkThemeWidget case MOZ_GTK_TREEVIEW:
@@ -2759,7 +2966,7 @@ moz_gtk_get_widget_border(GtkThemeWidget
break; break;
case MOZ_GTK_DROPDOWN_ENTRY: case MOZ_GTK_DROPDOWN_ENTRY:
ensure_combo_box_entry_widgets(); ensure_combo_box_entry_widgets();
@ -1054,7 +1108,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
break; break;
case MOZ_GTK_DROPDOWN_ARROW: case MOZ_GTK_DROPDOWN_ARROW:
ensure_combo_box_entry_widgets(); ensure_combo_box_entry_widgets();
@@ -2795,7 +2983,7 @@ moz_gtk_get_widget_border(GtkThemeWidget @@ -2795,7 +3002,7 @@ moz_gtk_get_widget_border(GtkThemeWidget
if (!wide_separators) { if (!wide_separators) {
style = gtk_widget_get_style_context(gComboBoxSeparatorWidget); style = gtk_widget_get_style_context(gComboBoxSeparatorWidget);
@ -1063,7 +1117,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
separator_width = border.left; separator_width = border.left;
} }
} }
@@ -2814,14 +3002,17 @@ moz_gtk_get_widget_border(GtkThemeWidget @@ -2814,14 +3021,17 @@ moz_gtk_get_widget_border(GtkThemeWidget
w = gTabWidget; w = gTabWidget;
break; break;
case MOZ_GTK_PROGRESSBAR: case MOZ_GTK_PROGRESSBAR:
@ -1085,7 +1139,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
break; break;
case MOZ_GTK_SCALE_HORIZONTAL: case MOZ_GTK_SCALE_HORIZONTAL:
ensure_scale_widget(); ensure_scale_widget();
@@ -2840,12 +3031,13 @@ moz_gtk_get_widget_border(GtkThemeWidget @@ -2840,12 +3050,13 @@ moz_gtk_get_widget_border(GtkThemeWidget
{ {
if (widget == MOZ_GTK_CHECKBUTTON_CONTAINER) { if (widget == MOZ_GTK_CHECKBUTTON_CONTAINER) {
ensure_checkbox_widget(); ensure_checkbox_widget();
@ -1102,7 +1156,15 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
*left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(w)); *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(w));
moz_gtk_add_style_border(style, moz_gtk_add_style_border(style,
@@ -2978,6 +3170,32 @@ moz_gtk_get_combo_box_entry_button_size( @@ -2904,7 +3115,6 @@ moz_gtk_get_widget_border(GtkThemeWidget
case MOZ_GTK_MENUSEPARATOR:
/* These widgets have no borders.*/
case MOZ_GTK_SPINBUTTON:
- case MOZ_GTK_TOOLTIP:
case MOZ_GTK_WINDOW:
case MOZ_GTK_RESIZER:
case MOZ_GTK_MENUARROW:
@@ -2978,6 +3188,32 @@ moz_gtk_get_combo_box_entry_button_size(
} }
gint gint
@ -1135,7 +1197,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
moz_gtk_get_tab_scroll_arrow_size(gint* width, gint* height) moz_gtk_get_tab_scroll_arrow_size(gint* width, gint* height)
{ {
gint arrow_size; gint arrow_size;
@@ -3030,7 +3248,7 @@ moz_gtk_get_toolbar_separator_width(gint @@ -3030,7 +3266,7 @@ moz_gtk_get_toolbar_separator_width(gint
"separator-width", &separator_width, "separator-width", &separator_width,
NULL); NULL);
/* Just in case... */ /* Just in case... */
@ -1144,7 +1206,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
*size = MAX(*size, (wide_separators ? separator_width : border.left)); *size = MAX(*size, (wide_separators ? separator_width : border.left));
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -3072,7 +3290,7 @@ moz_gtk_get_menu_separator_height(gint * @@ -3072,7 +3308,7 @@ moz_gtk_get_menu_separator_height(gint *
border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget)); border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget));
style = gtk_widget_get_style_context(gMenuSeparatorWidget); style = gtk_widget_get_style_context(gMenuSeparatorWidget);
@ -1153,7 +1215,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
gtk_style_context_save(style); gtk_style_context_save(style);
gtk_style_context_add_class(style, GTK_STYLE_CLASS_SEPARATOR); gtk_style_context_add_class(style, GTK_STYLE_CLASS_SEPARATOR);
@@ -3130,15 +3348,21 @@ moz_gtk_get_scrollbar_metrics(MozGtkScro @@ -3130,15 +3366,21 @@ moz_gtk_get_scrollbar_metrics(MozGtkScro
{ {
ensure_scrollbar_widget(); ensure_scrollbar_widget();
@ -1178,7 +1240,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }
@@ -3163,7 +3387,7 @@ moz_gtk_images_in_buttons() @@ -3163,7 +3405,7 @@ moz_gtk_images_in_buttons()
GtkSettings* settings; GtkSettings* settings;
ensure_button_widget(); ensure_button_widget();
@ -1187,7 +1249,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
g_object_get(settings, "gtk-button-images", &result, NULL); g_object_get(settings, "gtk-button-images", &result, NULL);
return result; return result;
@@ -3191,7 +3415,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType @@ -3191,7 +3433,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
} }
ensure_button_widget(); ensure_button_widget();
return moz_gtk_button_paint(cr, rect, state, return moz_gtk_button_paint(cr, rect, state,
@ -1196,7 +1258,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
direction); direction);
break; break;
case MOZ_GTK_CHECKBUTTON: case MOZ_GTK_CHECKBUTTON:
@@ -3241,7 +3465,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType @@ -3241,7 +3483,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
case MOZ_GTK_SPINBUTTON_ENTRY: case MOZ_GTK_SPINBUTTON_ENTRY:
ensure_spin_widget(); ensure_spin_widget();
return moz_gtk_entry_paint(cr, rect, state, return moz_gtk_entry_paint(cr, rect, state,
@ -1205,7 +1267,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
break; break;
case MOZ_GTK_GRIPPER: case MOZ_GTK_GRIPPER:
return moz_gtk_gripper_paint(cr, rect, state, return moz_gtk_gripper_paint(cr, rect, state,
@@ -3268,7 +3492,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType @@ -3268,7 +3510,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
case MOZ_GTK_ENTRY: case MOZ_GTK_ENTRY:
ensure_entry_widget(); ensure_entry_widget();
return moz_gtk_entry_paint(cr, rect, state, return moz_gtk_entry_paint(cr, rect, state,
@ -1214,7 +1276,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
break; break;
case MOZ_GTK_DROPDOWN: case MOZ_GTK_DROPDOWN:
return moz_gtk_combo_box_paint(cr, rect, state, direction); return moz_gtk_combo_box_paint(cr, rect, state, direction);
@@ -3280,7 +3504,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType @@ -3280,7 +3522,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
case MOZ_GTK_DROPDOWN_ENTRY: case MOZ_GTK_DROPDOWN_ENTRY:
ensure_combo_box_entry_widgets(); ensure_combo_box_entry_widgets();
return moz_gtk_entry_paint(cr, rect, state, return moz_gtk_entry_paint(cr, rect, state,
@ -1223,7 +1285,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
break; break;
case MOZ_GTK_CHECKBUTTON_CONTAINER: case MOZ_GTK_CHECKBUTTON_CONTAINER:
case MOZ_GTK_RADIOBUTTON_CONTAINER: case MOZ_GTK_RADIOBUTTON_CONTAINER:
@@ -3332,7 +3556,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType @@ -3332,7 +3574,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
(GtkArrowType) flags, direction); (GtkArrowType) flags, direction);
break; break;
case MOZ_GTK_MENUBAR: case MOZ_GTK_MENUBAR:
@ -1232,7 +1294,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
break; break;
case MOZ_GTK_MENUPOPUP: case MOZ_GTK_MENUPOPUP:
return moz_gtk_menu_popup_paint(cr, rect, direction); return moz_gtk_menu_popup_paint(cr, rect, direction);
@@ -3383,7 +3607,7 @@ GtkWidget* moz_gtk_get_scrollbar_widget( @@ -3383,7 +3625,7 @@ GtkWidget* moz_gtk_get_scrollbar_widget(
{ {
MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()"); MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()");
ensure_scrollbar_widget(); ensure_scrollbar_widget();
@ -1241,7 +1303,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
} }
gboolean moz_gtk_has_scrollbar_buttons(void) gboolean moz_gtk_has_scrollbar_buttons(void)
@@ -3391,7 +3615,7 @@ gboolean moz_gtk_has_scrollbar_buttons(v @@ -3391,7 +3633,7 @@ gboolean moz_gtk_has_scrollbar_buttons(v
gboolean backward, forward, secondary_backward, secondary_forward; gboolean backward, forward, secondary_backward, secondary_forward;
MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()"); MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()");
ensure_scrollbar_widget(); ensure_scrollbar_widget();
@ -1250,7 +1312,18 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
"has-backward-stepper", &backward, "has-backward-stepper", &backward,
"has-forward-stepper", &forward, "has-forward-stepper", &forward,
"has-secondary-backward-stepper", &secondary_backward, "has-secondary-backward-stepper", &secondary_backward,
@@ -3415,17 +3639,19 @@ moz_gtk_shutdown() @@ -3403,8 +3645,8 @@ gboolean moz_gtk_has_scrollbar_buttons(v
gint
moz_gtk_shutdown()
{
- if (gTooltipWidget)
- gtk_widget_destroy(gTooltipWidget);
+ moz_gtk_widget_free(&gTooltip);
+
/* This will destroy all of our widgets */
if (gProtoWindow)
gtk_widget_destroy(gProtoWindow);
@@ -3415,17 +3657,19 @@ moz_gtk_shutdown()
gProtoWindow = NULL; gProtoWindow = NULL;
gProtoLayout = NULL; gProtoLayout = NULL;
@ -1277,7 +1350,7 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
gComboBoxWidget = NULL; gComboBoxWidget = NULL;
gComboBoxButtonWidget = NULL; gComboBoxButtonWidget = NULL;
gComboBoxSeparatorWidget = NULL; gComboBoxSeparatorWidget = NULL;
@@ -3433,12 +3659,12 @@ moz_gtk_shutdown() @@ -3433,14 +3677,13 @@ moz_gtk_shutdown()
gComboBoxEntryWidget = NULL; gComboBoxEntryWidget = NULL;
gComboBoxEntryButtonWidget = NULL; gComboBoxEntryButtonWidget = NULL;
gComboBoxEntryArrowWidget = NULL; gComboBoxEntryArrowWidget = NULL;
@ -1290,11 +1363,13 @@ diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/g
- gProgressWidget = NULL; - gProgressWidget = NULL;
+ moz_gtk_widget_free(&gProgressBar); + moz_gtk_widget_free(&gProgressBar);
gTabWidget = NULL; gTabWidget = NULL;
gTooltipWidget = NULL; - gTooltipWidget = NULL;
gMenuBarWidget = NULL; gMenuBarWidget = NULL;
diff -up firefox-46.0/widget/gtk/gtkdrawing.h.gtk3-20 firefox-46.0/widget/gtk/gtkdrawing.h gMenuBarItemWidget = NULL;
--- firefox-46.0/widget/gtk/gtkdrawing.h.gtk3-20 2016-04-22 02:37:27.000000000 +0200 gMenuPopupWidget = NULL;
+++ firefox-46.0/widget/gtk/gtkdrawing.h 2016-04-25 14:42:42.000000000 +0200 diff -up firefox-46.0.1/widget/gtk/gtkdrawing.h.gtk3-20 firefox-46.0.1/widget/gtk/gtkdrawing.h
--- firefox-46.0.1/widget/gtk/gtkdrawing.h.gtk3-20 2016-05-03 07:31:12.000000000 +0200
+++ firefox-46.0.1/widget/gtk/gtkdrawing.h 2016-05-19 15:20:11.656519199 +0200
@@ -67,6 +67,13 @@ typedef enum { @@ -67,6 +67,13 @@ typedef enum {
MOZ_GTK_TAB_SELECTED = 1 << 10 MOZ_GTK_TAB_SELECTED = 1 << 10
} GtkTabFlags; } GtkTabFlags;
@ -1332,9 +1407,9 @@ diff -up firefox-46.0/widget/gtk/gtkdrawing.h.gtk3-20 firefox-46.0/widget/gtk/gt
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
diff -up firefox-46.0/widget/gtk/mozgtk/mozgtk.c.gtk3-20 firefox-46.0/widget/gtk/mozgtk/mozgtk.c diff -up firefox-46.0.1/widget/gtk/mozgtk/mozgtk.c.gtk3-20 firefox-46.0.1/widget/gtk/mozgtk/mozgtk.c
--- firefox-46.0/widget/gtk/mozgtk/mozgtk.c.gtk3-20 2016-04-22 02:37:27.000000000 +0200 --- firefox-46.0.1/widget/gtk/mozgtk/mozgtk.c.gtk3-20 2016-05-03 07:31:12.000000000 +0200
+++ firefox-46.0/widget/gtk/mozgtk/mozgtk.c 2016-04-25 14:46:15.299592716 +0200 +++ firefox-46.0.1/widget/gtk/mozgtk/mozgtk.c 2016-05-20 10:40:19.442320669 +0200
@@ -504,6 +504,11 @@ STUB(gtk_window_set_type_hint) @@ -504,6 +504,11 @@ STUB(gtk_window_set_type_hint)
STUB(gtk_window_set_wmclass) STUB(gtk_window_set_wmclass)
STUB(gtk_window_unfullscreen) STUB(gtk_window_unfullscreen)
@ -1347,7 +1422,7 @@ diff -up firefox-46.0/widget/gtk/mozgtk/mozgtk.c.gtk3-20 firefox-46.0/widget/gtk
#endif #endif
#ifdef GTK3_SYMBOLS #ifdef GTK3_SYMBOLS
@@ -581,6 +586,13 @@ STUB(gtk_color_chooser_get_type) @@ -581,6 +586,14 @@ STUB(gtk_color_chooser_get_type)
STUB(gtk_color_chooser_set_rgba) STUB(gtk_color_chooser_set_rgba)
STUB(gtk_color_chooser_get_rgba) STUB(gtk_color_chooser_get_rgba)
STUB(gtk_color_chooser_set_use_alpha) STUB(gtk_color_chooser_set_use_alpha)
@ -1358,12 +1433,13 @@ diff -up firefox-46.0/widget/gtk/mozgtk/mozgtk.c.gtk3-20 firefox-46.0/widget/gtk
+STUB(gtk_widget_path_iter_get_state) +STUB(gtk_widget_path_iter_get_state)
+STUB(gtk_style_context_set_parent) +STUB(gtk_style_context_set_parent)
+STUB(gtk_widget_path_unref) +STUB(gtk_widget_path_unref)
+STUB(gtk_tooltip_get_type)
#endif #endif
#ifdef GTK2_SYMBOLS #ifdef GTK2_SYMBOLS
diff -up firefox-46.0/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-46.0/widget/gtk/nsLookAndFeel.cpp diff -up firefox-46.0.1/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-46.0.1/widget/gtk/nsLookAndFeel.cpp
--- firefox-46.0/widget/gtk/nsLookAndFeel.cpp.gtk3-20 2016-04-22 02:37:27.000000000 +0200 --- firefox-46.0.1/widget/gtk/nsLookAndFeel.cpp.gtk3-20 2016-05-03 07:31:12.000000000 +0200
+++ firefox-46.0/widget/gtk/nsLookAndFeel.cpp 2016-04-25 14:18:25.000000000 +0200 +++ firefox-46.0.1/widget/gtk/nsLookAndFeel.cpp 2016-05-20 13:53:54.085049707 +0200
@@ -353,14 +353,18 @@ nsLookAndFeel::NativeGetColor(ColorID aI @@ -353,14 +353,18 @@ nsLookAndFeel::NativeGetColor(ColorID aI
case eColorID_activeborder: case eColorID_activeborder:
// active window border // active window border
@ -1419,7 +1495,7 @@ diff -up firefox-46.0/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-46.0/widget/g
aColor = GDK_RGBA_TO_NS_RGBA(gdk_color); aColor = GDK_RGBA_TO_NS_RGBA(gdk_color);
break; break;
case eColorID__moz_buttonhovertext: case eColorID__moz_buttonhovertext:
@@ -1110,7 +1121,7 @@ nsLookAndFeel::Init() @@ -1110,27 +1126,29 @@ nsLookAndFeel::Init()
style = create_context(path); style = create_context(path);
gtk_style_context_add_class(style, GTK_STYLE_CLASS_SCROLLBAR); gtk_style_context_add_class(style, GTK_STYLE_CLASS_SCROLLBAR);
gtk_style_context_add_class(style, GTK_STYLE_CLASS_TROUGH); gtk_style_context_add_class(style, GTK_STYLE_CLASS_TROUGH);
@ -1428,9 +1504,9 @@ diff -up firefox-46.0/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-46.0/widget/g
sMozScrollbar = GDK_RGBA_TO_NS_RGBA(color); sMozScrollbar = GDK_RGBA_TO_NS_RGBA(color);
g_object_unref(style); g_object_unref(style);
@@ -1118,18 +1129,18 @@ nsLookAndFeel::Init() // Window colors
style = create_context(path); style = create_context(path);
gtk_style_context_save(style); - gtk_style_context_save(style);
gtk_style_context_add_class(style, GTK_STYLE_CLASS_BACKGROUND); gtk_style_context_add_class(style, GTK_STYLE_CLASS_BACKGROUND);
- gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); - gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); + gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color);
@ -1438,20 +1514,27 @@ diff -up firefox-46.0/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-46.0/widget/g
- gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); - gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); + gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color);
sMozWindowText = GDK_RGBA_TO_NS_RGBA(color); sMozWindowText = GDK_RGBA_TO_NS_RGBA(color);
gtk_style_context_restore(style); - gtk_style_context_restore(style);
+ g_object_unref(style);
// tooltip foreground and background // tooltip foreground and background
gtk_style_context_add_class(style, GTK_STYLE_CLASS_TOOLTIP); - gtk_style_context_add_class(style, GTK_STYLE_CLASS_TOOLTIP);
+ GtkCssNode tooltipPath[] = {
+ { GTK_TYPE_TOOLTIP, "tooltip", NULL, NULL},
+ };
+ style = moz_gtk_style_create(tooltipPath, NULL);
+ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color);
+ sInfoText = GDK_RGBA_TO_NS_RGBA(color);
gtk_style_context_add_class(style, GTK_STYLE_CLASS_BACKGROUND); gtk_style_context_add_class(style, GTK_STYLE_CLASS_BACKGROUND);
- gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); - gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); + gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color);
sInfoBackground = GDK_RGBA_TO_NS_RGBA(color); sInfoBackground = GDK_RGBA_TO_NS_RGBA(color);
- gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); - gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); - sInfoText = GDK_RGBA_TO_NS_RGBA(color);
sInfoText = GDK_RGBA_TO_NS_RGBA(color);
g_object_unref(style); g_object_unref(style);
@@ -1144,20 +1155,26 @@ nsLookAndFeel::Init() // menu foreground & menu background
@@ -1144,20 +1162,26 @@ nsLookAndFeel::Init()
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
style = gtk_widget_get_style_context(accel_label); style = gtk_widget_get_style_context(accel_label);
@ -1483,7 +1566,7 @@ diff -up firefox-46.0/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-46.0/widget/g
g_object_unref(menu); g_object_unref(menu);
#endif #endif
@@ -1266,44 +1283,54 @@ nsLookAndFeel::Init() @@ -1266,44 +1290,54 @@ nsLookAndFeel::Init()
GDK_COLOR_TO_NS_RGB(style->dark[GTK_STATE_NORMAL]); GDK_COLOR_TO_NS_RGB(style->dark[GTK_STATE_NORMAL]);
} }
#else #else
@ -1555,7 +1638,7 @@ diff -up firefox-46.0/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-46.0/widget/g
// GTK's guide to fancy odd row background colors: // GTK's guide to fancy odd row background colors:
// 1) Check if a theme explicitly defines an odd row color // 1) Check if a theme explicitly defines an odd row color
@@ -1316,7 +1343,7 @@ nsLookAndFeel::Init() @@ -1316,7 +1350,7 @@ nsLookAndFeel::Init()
// Get odd row background color // Get odd row background color
gtk_style_context_save(style); gtk_style_context_save(style);
gtk_style_context_add_region(style, GTK_STYLE_REGION_ROW, GTK_REGION_ODD); gtk_style_context_add_region(style, GTK_STYLE_REGION_ROW, GTK_REGION_ODD);
@ -1564,7 +1647,7 @@ diff -up firefox-46.0/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-46.0/widget/g
sOddCellBackground = GDK_RGBA_TO_NS_RGBA(color); sOddCellBackground = GDK_RGBA_TO_NS_RGBA(color);
gtk_style_context_restore(style); gtk_style_context_restore(style);
@@ -1334,9 +1361,11 @@ nsLookAndFeel::Init() @@ -1334,9 +1368,11 @@ nsLookAndFeel::Init()
gtk_container_add(GTK_CONTAINER(parent), infoBar); gtk_container_add(GTK_CONTAINER(parent), infoBar);
gtk_container_add(GTK_CONTAINER(infoBarContent), infoBarLabel); gtk_container_add(GTK_CONTAINER(infoBarContent), infoBarLabel);
style = gtk_widget_get_style_context(infoBarLabel); style = gtk_widget_get_style_context(infoBarLabel);
@ -1577,9 +1660,9 @@ diff -up firefox-46.0/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-46.0/widget/g
#endif #endif
// Some themes have a unified menu bar, and support window dragging on it // Some themes have a unified menu bar, and support window dragging on it
gboolean supports_menubar_drag = FALSE; gboolean supports_menubar_drag = FALSE;
diff -up firefox-46.0/widget/gtk/nsNativeThemeGTK.cpp.gtk3-20 firefox-46.0/widget/gtk/nsNativeThemeGTK.cpp diff -up firefox-46.0.1/widget/gtk/nsNativeThemeGTK.cpp.gtk3-20 firefox-46.0.1/widget/gtk/nsNativeThemeGTK.cpp
--- firefox-46.0/widget/gtk/nsNativeThemeGTK.cpp.gtk3-20 2016-04-25 14:46:15.300592722 +0200 --- firefox-46.0.1/widget/gtk/nsNativeThemeGTK.cpp.gtk3-20 2016-05-03 07:31:12.000000000 +0200
+++ firefox-46.0/widget/gtk/nsNativeThemeGTK.cpp 2016-04-25 14:40:42.000000000 +0200 +++ firefox-46.0.1/widget/gtk/nsNativeThemeGTK.cpp 2016-05-19 15:20:11.658519202 +0200
@@ -1567,9 +1567,6 @@ nsNativeThemeGTK::GetMinimumWidgetSize(n @@ -1567,9 +1567,6 @@ nsNativeThemeGTK::GetMinimumWidgetSize(n
case NS_THEME_RADIO_CONTAINER: case NS_THEME_RADIO_CONTAINER:
case NS_THEME_CHECKBOX_LABEL: case NS_THEME_CHECKBOX_LABEL:

View File

@ -85,7 +85,7 @@
Summary: Mozilla Firefox Web browser Summary: Mozilla Firefox Web browser
Name: firefox Name: firefox
Version: 46.0.1 Version: 46.0.1
Release: 5%{?pre_tag}%{?dist} Release: 6%{?pre_tag}%{?dist}
URL: https://www.mozilla.org/firefox/ URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+ License: MPLv1.1 or GPLv2+ or LGPLv2+
Group: Applications/Internet Group: Applications/Internet
@ -793,6 +793,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#--------------------------------------------------------------------- #---------------------------------------------------------------------
%changelog %changelog
* Fri May 20 2016 Martin Stransky <stransky@redhat.com> - 46.0.1-6
- Updated Gtk3.20 patch - fixed tooltips
* Thu May 19 2016 Martin Stransky <stransky@redhat.com> - 46.0.1-5 * Thu May 19 2016 Martin Stransky <stransky@redhat.com> - 46.0.1-5
- Added a fix for mozbz#1245783 - gcc6.1 crashes in JIT - Added a fix for mozbz#1245783 - gcc6.1 crashes in JIT