[SVN-Commit] r1786 - branches/firefox34/www/firefox-nightly/files branches/firefox34/www/firefox/files trunk/www/firefox-nightly/files trunk/www/firefox/files
svn-freebsd-gecko at chruetertee.ch
svn-freebsd-gecko at chruetertee.ch
Fri Dec 5 09:15:14 UTC 2014
Author: jbeich
Date: Fri Dec 5 09:14:59 2014
New Revision: 1786
Log:
add more gtk3 fixes
Added:
branches/firefox34/www/firefox-nightly/files/patch-bug1073117
branches/firefox34/www/firefox/files/patch-bug1051209
branches/firefox34/www/firefox/files/patch-bug1073117
branches/firefox34/www/firefox/files/patch-bug1101582
trunk/www/firefox-nightly/files/patch-bug1073117
trunk/www/firefox/files/patch-bug1073117
trunk/www/firefox/files/patch-bug1101582
Added: branches/firefox34/www/firefox-nightly/files/patch-bug1073117
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/firefox34/www/firefox-nightly/files/patch-bug1073117 Fri Dec 5 09:14:59 2014 (r1786)
@@ -0,0 +1,74 @@
+commit 44cb57e
+Author: Martin Stransky <stransky at redhat.com>
+Date: Tue Dec 2 20:24:27 2014 +0300
+
+ Bug 1073117 - Add new GTK_STATE_FLAG_CHECKED for checkbox rendering, r=karlt
+---
+ widget/gtk/gtk3drawing.c | 21 ++++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
+
+diff --git widget/gtk/gtk3drawing.c widget/gtk/gtk3drawing.c
+index e9e21b1..750140c 100644
+--- widget/gtk/gtk3drawing.c
++++ widget/gtk/gtk3drawing.c
+@@ -64,6 +64,7 @@ static GtkWidget* gScrolledWindowWidget;
+
+ static style_prop_t style_prop_func;
+ static gboolean have_arrow_scaling;
++static gboolean checkbox_check_state;
+ static gboolean is_initialized;
+
+ #define ARROW_UP 0
+@@ -71,6 +72,10 @@ static gboolean is_initialized;
+ #define ARROW_RIGHT G_PI_2
+ #define ARROW_LEFT (G_PI+G_PI_2)
+
++#if !GTK_CHECK_VERSION(3,14,0)
++#define GTK_STATE_FLAG_CHECKED (1 << 11)
++#endif
++
+ static GtkStateFlags
+ GetStateFlagsFromGtkWidgetState(GtkWidgetState* state)
+ {
+@@ -714,6 +719,11 @@ moz_gtk_init()
+ is_initialized = TRUE;
+ have_arrow_scaling = (gtk_major_version > 2 ||
+ (gtk_major_version == 2 && gtk_minor_version >= 12));
++ if (gtk_major_version > 3 ||
++ (gtk_major_version == 3 && gtk_minor_version >= 14))
++ checkbox_check_state = GTK_STATE_FLAG_CHECKED;
++ else
++ checkbox_check_state = GTK_STATE_FLAG_ACTIVE;
+
+ /* Add style property to GtkEntry.
+ * Adding the style property to the normal GtkEntry class means that it
+@@ -1007,7 +1017,7 @@
+
+ if (isradio) {
+ gtk_style_context_add_class(style, GTK_STYLE_CLASS_RADIO);
+- gtk_style_context_set_state(style, selected ? GTK_STATE_FLAG_ACTIVE :
++ gtk_style_context_set_state(style, selected ? checkbox_check_state :
+ GTK_STATE_FLAG_NORMAL);
+ gtk_render_option(style, cr, x, y, width, height);
+ if (state->focused) {
+@@ -1025,7 +1035,7 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRectangle* rect,
+ gtk_style_context_set_state(style, GTK_STATE_FLAG_INCONSISTENT);
+ gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(gCheckboxWidget), TRUE);
+ } else if (selected) {
+- gtk_style_context_set_state(style, GTK_STATE_FLAG_ACTIVE);
++ gtk_style_context_set_state(style, checkbox_check_state);
+ } else {
+ gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(gCheckboxWidget), FALSE);
+ }
+@@ -2588,8 +2598,9 @@ moz_gtk_check_menu_item_paint(cairo_t *cr, GdkRectangle* rect,
+ gtk_style_context_add_class(style, GTK_STYLE_CLASS_CHECK);
+ }
+
+- if (checked)
+- state_flags |= GTK_STATE_FLAG_ACTIVE;
++ if (checked) {
++ state_flags |= checkbox_check_state;
++ }
+
+ gtk_style_context_set_state(style, state_flags);
+ gtk_style_context_get_padding(style, state_flags, &padding);
Added: branches/firefox34/www/firefox/files/patch-bug1051209
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/firefox34/www/firefox/files/patch-bug1051209 Fri Dec 5 09:14:59 2014 (r1786)
@@ -0,0 +1,32 @@
+commit 6854b08
+Author: Mike Hommey <mh+mozilla at glandium.org>
+Date: Thu Sep 11 12:24:44 2014 +0900
+
+ Bug 1051209 - Properly link libxul.so on GTK+3 builds after bug 1045783. r=mshal
+---
+ configure.in | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git configure.in configure.in
+index 63846bb..0af7bee 100644
+--- configure.in
++++ configure.in
+@@ -4154,7 +4154,6 @@ cairo-gtk3)
+ USE_FC_FREETYPE=1
+
+ TK_CFLAGS='$(MOZ_GTK3_CFLAGS)'
+- TK_LIBS='$(MOZ_GTK3_LIBS)'
+ MOZ_WIDGET_GTK=3
+ AC_DEFINE_UNQUOTED(MOZ_WIDGET_GTK,$MOZ_WIDGET_GTK)
+ MOZ_PDF_PRINTING=1
+@@ -4267,6 +4266,10 @@ if test "$COMPILE_ENVIRONMENT"; then
+ if test "$MOZ_ENABLE_GTK3"; then
+ PKG_CHECK_MODULES(MOZ_GTK3, gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
+ MOZ_GTK3_CFLAGS="-I${_topsrcdir}/widget/gtk/compat-gtk3 $MOZ_GTK3_CFLAGS"
++ dnl Contrary to MOZ_GTK2_LIBS, MOZ_GTK3_LIBS needs to be literally added to TK_LIBS instead
++ dnl of a make reference because of how TK_LIBS is mangled in toolkit/library/moz.build
++ dnl for GTK+3 builds.
++ TK_LIBS=$MOZ_GTK3_LIBS
+ fi
+ if test "$MOZ_ENABLE_GTK"; then
+ if test "$MOZ_X11"; then
Added: branches/firefox34/www/firefox/files/patch-bug1073117
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/firefox34/www/firefox/files/patch-bug1073117 Fri Dec 5 09:14:59 2014 (r1786)
@@ -0,0 +1,74 @@
+commit 44cb57e
+Author: Martin Stransky <stransky at redhat.com>
+Date: Tue Dec 2 20:24:27 2014 +0300
+
+ Bug 1073117 - Add new GTK_STATE_FLAG_CHECKED for checkbox rendering, r=karlt
+---
+ widget/gtk/gtk3drawing.c | 21 ++++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
+
+diff --git widget/gtk/gtk3drawing.c widget/gtk/gtk3drawing.c
+index e9e21b1..750140c 100644
+--- widget/gtk/gtk3drawing.c
++++ widget/gtk/gtk3drawing.c
+@@ -64,6 +64,7 @@ static GtkWidget* gScrolledWindowWidget;
+
+ static style_prop_t style_prop_func;
+ static gboolean have_arrow_scaling;
++static gboolean checkbox_check_state;
+ static gboolean is_initialized;
+
+ #define ARROW_UP 0
+@@ -71,6 +72,10 @@ static gboolean is_initialized;
+ #define ARROW_RIGHT G_PI_2
+ #define ARROW_LEFT (G_PI+G_PI_2)
+
++#if !GTK_CHECK_VERSION(3,14,0)
++#define GTK_STATE_FLAG_CHECKED (1 << 11)
++#endif
++
+ static GtkStateFlags
+ GetStateFlagsFromGtkWidgetState(GtkWidgetState* state)
+ {
+@@ -714,6 +719,11 @@ moz_gtk_init()
+ is_initialized = TRUE;
+ have_arrow_scaling = (gtk_major_version > 2 ||
+ (gtk_major_version == 2 && gtk_minor_version >= 12));
++ if (gtk_major_version > 3 ||
++ (gtk_major_version == 3 && gtk_minor_version >= 14))
++ checkbox_check_state = GTK_STATE_FLAG_CHECKED;
++ else
++ checkbox_check_state = GTK_STATE_FLAG_ACTIVE;
+
+ /* Add style property to GtkEntry.
+ * Adding the style property to the normal GtkEntry class means that it
+@@ -1007,7 +1017,7 @@
+
+ if (isradio) {
+ gtk_style_context_add_class(style, GTK_STYLE_CLASS_RADIO);
+- gtk_style_context_set_state(style, selected ? GTK_STATE_FLAG_ACTIVE :
++ gtk_style_context_set_state(style, selected ? checkbox_check_state :
+ GTK_STATE_FLAG_NORMAL);
+ gtk_render_option(style, cr, x, y, width, height);
+ if (state->focused) {
+@@ -1025,7 +1035,7 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRectangle* rect,
+ gtk_style_context_set_state(style, GTK_STATE_FLAG_INCONSISTENT);
+ gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(gCheckboxWidget), TRUE);
+ } else if (selected) {
+- gtk_style_context_set_state(style, GTK_STATE_FLAG_ACTIVE);
++ gtk_style_context_set_state(style, checkbox_check_state);
+ } else {
+ gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(gCheckboxWidget), FALSE);
+ }
+@@ -2588,8 +2598,9 @@ moz_gtk_check_menu_item_paint(cairo_t *cr, GdkRectangle* rect,
+ gtk_style_context_add_class(style, GTK_STYLE_CLASS_CHECK);
+ }
+
+- if (checked)
+- state_flags |= GTK_STATE_FLAG_ACTIVE;
++ if (checked) {
++ state_flags |= checkbox_check_state;
++ }
+
+ gtk_style_context_set_state(style, state_flags);
+ gtk_style_context_get_padding(style, state_flags, &padding);
Added: branches/firefox34/www/firefox/files/patch-bug1101582
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/firefox34/www/firefox/files/patch-bug1101582 Fri Dec 5 09:14:59 2014 (r1786)
@@ -0,0 +1,82 @@
+commit 8142810
+Author: Martin Stransky <stransky at redhat.com>
+Date: Thu Nov 27 04:08:00 2014 +0100
+
+ Bug 1101582 - [GTK3] - Use window background color for ThreeDFace,ButtonFace. r=karlt
+ This fixes missing borders on non-natively-styled textareas.
+---
+ widget/gtk/nsLookAndFeel.cpp | 21 ++++++++++-----------
+ widget/gtk/nsLookAndFeel.h | 2 +-
+ 2 files changed, 11 insertions(+), 12 deletions(-)
+
+diff --git widget/gtk/nsLookAndFeel.cpp widget/gtk/nsLookAndFeel.cpp
+index 93066b4..3562cf2 100644
+--- widget/gtk/nsLookAndFeel.cpp
++++ widget/gtk/nsLookAndFeel.cpp
+@@ -284,10 +284,17 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor)
+ #endif
+ break;
+
++ case eColorID_threedlightshadow:
++ // 3-D highlighted inner edge color
++ // always same as background in GTK code
+ case eColorID_threedface:
+ case eColorID_buttonface:
+ // 3-D face color
+- aColor = sFrameBackground;
++#if (MOZ_WIDGET_GTK == 3)
++ aColor = sMozWindowBackground;
++#else
++ aColor = sButtonBackground;
++#endif
+ break;
+
+ case eColorID_buttontext:
+@@ -302,11 +309,6 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor)
+ aColor = sFrameOuterLightBorder;
+ break;
+
+- case eColorID_threedlightshadow:
+- // 3-D highlighted inner edge color
+- aColor = sFrameBackground; // always same as background in GTK code
+- break;
+-
+ case eColorID_buttonshadow:
+ // 3-D shadow edge color
+ case eColorID_threedshadow:
+@@ -1141,7 +1143,7 @@ nsLookAndFeel::Init()
+
+ style = gtk_widget_get_style(button);
+ if (style) {
+- sFrameBackground = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);
++ sButtonBackground = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);
+ sFrameOuterLightBorder =
+ GDK_COLOR_TO_NS_RGB(style->light[GTK_STATE_NORMAL]);
+ sFrameInnerDarkBorder =
+@@ -1189,12 +1191,9 @@ nsLookAndFeel::Init()
+ GtkWidget *frame = gtk_frame_new(nullptr);
+ gtk_container_add(GTK_CONTAINER(parent), frame);
+
+- style = gtk_widget_get_style_context(frame);
+- gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color);
+- sFrameBackground = GDK_RGBA_TO_NS_RGBA(color);
+-
+ // TODO GTK3 - update sFrameOuterLightBorder
+ // for GTK_BORDER_STYLE_INSET/OUTSET/GROVE/RIDGE border styles (Bug 978172).
++ style = gtk_widget_get_style_context(frame);
+ gtk_style_context_get_border_color(style, GTK_STATE_FLAG_NORMAL, &color);
+ sFrameInnerDarkBorder = sFrameOuterLightBorder = GDK_RGBA_TO_NS_RGBA(color);
+ #endif
+diff --git widget/gtk/nsLookAndFeel.h widget/gtk/nsLookAndFeel.h
+index be15179..aabbca6 100644
+--- widget/gtk/nsLookAndFeel.h
++++ widget/gtk/nsLookAndFeel.h
+@@ -64,7 +64,7 @@ protected:
+ nscolor sMenuHoverText;
+ nscolor sButtonText;
+ nscolor sButtonHoverText;
+- nscolor sFrameBackground;
++ nscolor sButtonBackground;
+ nscolor sFrameOuterLightBorder;
+ nscolor sFrameInnerDarkBorder;
+ nscolor sOddCellBackground;
Added: trunk/www/firefox-nightly/files/patch-bug1073117
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/www/firefox-nightly/files/patch-bug1073117 Fri Dec 5 09:14:59 2014 (r1786)
@@ -0,0 +1,74 @@
+commit 44cb57e
+Author: Martin Stransky <stransky at redhat.com>
+Date: Tue Dec 2 20:24:27 2014 +0300
+
+ Bug 1073117 - Add new GTK_STATE_FLAG_CHECKED for checkbox rendering, r=karlt
+---
+ widget/gtk/gtk3drawing.c | 21 ++++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
+
+diff --git widget/gtk/gtk3drawing.c widget/gtk/gtk3drawing.c
+index e9e21b1..750140c 100644
+--- widget/gtk/gtk3drawing.c
++++ widget/gtk/gtk3drawing.c
+@@ -64,6 +64,7 @@ static GtkWidget* gScrolledWindowWidget;
+
+ static style_prop_t style_prop_func;
+ static gboolean have_arrow_scaling;
++static gboolean checkbox_check_state;
+ static gboolean is_initialized;
+
+ #define ARROW_UP 0
+@@ -71,6 +72,10 @@ static gboolean is_initialized;
+ #define ARROW_RIGHT G_PI_2
+ #define ARROW_LEFT (G_PI+G_PI_2)
+
++#if !GTK_CHECK_VERSION(3,14,0)
++#define GTK_STATE_FLAG_CHECKED (1 << 11)
++#endif
++
+ static GtkStateFlags
+ GetStateFlagsFromGtkWidgetState(GtkWidgetState* state)
+ {
+@@ -714,6 +719,11 @@ moz_gtk_init()
+ is_initialized = TRUE;
+ have_arrow_scaling = (gtk_major_version > 2 ||
+ (gtk_major_version == 2 && gtk_minor_version >= 12));
++ if (gtk_major_version > 3 ||
++ (gtk_major_version == 3 && gtk_minor_version >= 14))
++ checkbox_check_state = GTK_STATE_FLAG_CHECKED;
++ else
++ checkbox_check_state = GTK_STATE_FLAG_ACTIVE;
+
+ /* Add style property to GtkEntry.
+ * Adding the style property to the normal GtkEntry class means that it
+@@ -1007,7 +1017,7 @@
+
+ if (isradio) {
+ gtk_style_context_add_class(style, GTK_STYLE_CLASS_RADIO);
+- gtk_style_context_set_state(style, selected ? GTK_STATE_FLAG_ACTIVE :
++ gtk_style_context_set_state(style, selected ? checkbox_check_state :
+ GTK_STATE_FLAG_NORMAL);
+ gtk_render_option(style, cr, x, y, width, height);
+ if (state->focused) {
+@@ -1025,7 +1035,7 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRectangle* rect,
+ gtk_style_context_set_state(style, GTK_STATE_FLAG_INCONSISTENT);
+ gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(gCheckboxWidget), TRUE);
+ } else if (selected) {
+- gtk_style_context_set_state(style, GTK_STATE_FLAG_ACTIVE);
++ gtk_style_context_set_state(style, checkbox_check_state);
+ } else {
+ gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(gCheckboxWidget), FALSE);
+ }
+@@ -2588,8 +2598,9 @@ moz_gtk_check_menu_item_paint(cairo_t *cr, GdkRectangle* rect,
+ gtk_style_context_add_class(style, GTK_STYLE_CLASS_CHECK);
+ }
+
+- if (checked)
+- state_flags |= GTK_STATE_FLAG_ACTIVE;
++ if (checked) {
++ state_flags |= checkbox_check_state;
++ }
+
+ gtk_style_context_set_state(style, state_flags);
+ gtk_style_context_get_padding(style, state_flags, &padding);
Added: trunk/www/firefox/files/patch-bug1073117
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/www/firefox/files/patch-bug1073117 Fri Dec 5 09:14:59 2014 (r1786)
@@ -0,0 +1,74 @@
+commit 44cb57e
+Author: Martin Stransky <stransky at redhat.com>
+Date: Tue Dec 2 20:24:27 2014 +0300
+
+ Bug 1073117 - Add new GTK_STATE_FLAG_CHECKED for checkbox rendering, r=karlt
+---
+ widget/gtk/gtk3drawing.c | 21 ++++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
+
+diff --git widget/gtk/gtk3drawing.c widget/gtk/gtk3drawing.c
+index e9e21b1..750140c 100644
+--- widget/gtk/gtk3drawing.c
++++ widget/gtk/gtk3drawing.c
+@@ -64,6 +64,7 @@ static GtkWidget* gScrolledWindowWidget;
+
+ static style_prop_t style_prop_func;
+ static gboolean have_arrow_scaling;
++static gboolean checkbox_check_state;
+ static gboolean is_initialized;
+
+ #define ARROW_UP 0
+@@ -71,6 +72,10 @@ static gboolean is_initialized;
+ #define ARROW_RIGHT G_PI_2
+ #define ARROW_LEFT (G_PI+G_PI_2)
+
++#if !GTK_CHECK_VERSION(3,14,0)
++#define GTK_STATE_FLAG_CHECKED (1 << 11)
++#endif
++
+ static GtkStateFlags
+ GetStateFlagsFromGtkWidgetState(GtkWidgetState* state)
+ {
+@@ -714,6 +719,11 @@ moz_gtk_init()
+ is_initialized = TRUE;
+ have_arrow_scaling = (gtk_major_version > 2 ||
+ (gtk_major_version == 2 && gtk_minor_version >= 12));
++ if (gtk_major_version > 3 ||
++ (gtk_major_version == 3 && gtk_minor_version >= 14))
++ checkbox_check_state = GTK_STATE_FLAG_CHECKED;
++ else
++ checkbox_check_state = GTK_STATE_FLAG_ACTIVE;
+
+ /* Add style property to GtkEntry.
+ * Adding the style property to the normal GtkEntry class means that it
+@@ -1007,7 +1017,7 @@
+
+ if (isradio) {
+ gtk_style_context_add_class(style, GTK_STYLE_CLASS_RADIO);
+- gtk_style_context_set_state(style, selected ? GTK_STATE_FLAG_ACTIVE :
++ gtk_style_context_set_state(style, selected ? checkbox_check_state :
+ GTK_STATE_FLAG_NORMAL);
+ gtk_render_option(style, cr, x, y, width, height);
+ if (state->focused) {
+@@ -1025,7 +1035,7 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRectangle* rect,
+ gtk_style_context_set_state(style, GTK_STATE_FLAG_INCONSISTENT);
+ gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(gCheckboxWidget), TRUE);
+ } else if (selected) {
+- gtk_style_context_set_state(style, GTK_STATE_FLAG_ACTIVE);
++ gtk_style_context_set_state(style, checkbox_check_state);
+ } else {
+ gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(gCheckboxWidget), FALSE);
+ }
+@@ -2588,8 +2598,9 @@ moz_gtk_check_menu_item_paint(cairo_t *cr, GdkRectangle* rect,
+ gtk_style_context_add_class(style, GTK_STYLE_CLASS_CHECK);
+ }
+
+- if (checked)
+- state_flags |= GTK_STATE_FLAG_ACTIVE;
++ if (checked) {
++ state_flags |= checkbox_check_state;
++ }
+
+ gtk_style_context_set_state(style, state_flags);
+ gtk_style_context_get_padding(style, state_flags, &padding);
Added: trunk/www/firefox/files/patch-bug1101582
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/www/firefox/files/patch-bug1101582 Fri Dec 5 09:14:59 2014 (r1786)
@@ -0,0 +1,82 @@
+commit 8142810
+Author: Martin Stransky <stransky at redhat.com>
+Date: Thu Nov 27 04:08:00 2014 +0100
+
+ Bug 1101582 - [GTK3] - Use window background color for ThreeDFace,ButtonFace. r=karlt
+ This fixes missing borders on non-natively-styled textareas.
+---
+ widget/gtk/nsLookAndFeel.cpp | 21 ++++++++++-----------
+ widget/gtk/nsLookAndFeel.h | 2 +-
+ 2 files changed, 11 insertions(+), 12 deletions(-)
+
+diff --git widget/gtk/nsLookAndFeel.cpp widget/gtk/nsLookAndFeel.cpp
+index 93066b4..3562cf2 100644
+--- widget/gtk/nsLookAndFeel.cpp
++++ widget/gtk/nsLookAndFeel.cpp
+@@ -284,10 +284,17 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor)
+ #endif
+ break;
+
++ case eColorID_threedlightshadow:
++ // 3-D highlighted inner edge color
++ // always same as background in GTK code
+ case eColorID_threedface:
+ case eColorID_buttonface:
+ // 3-D face color
+- aColor = sFrameBackground;
++#if (MOZ_WIDGET_GTK == 3)
++ aColor = sMozWindowBackground;
++#else
++ aColor = sButtonBackground;
++#endif
+ break;
+
+ case eColorID_buttontext:
+@@ -302,11 +309,6 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor)
+ aColor = sFrameOuterLightBorder;
+ break;
+
+- case eColorID_threedlightshadow:
+- // 3-D highlighted inner edge color
+- aColor = sFrameBackground; // always same as background in GTK code
+- break;
+-
+ case eColorID_buttonshadow:
+ // 3-D shadow edge color
+ case eColorID_threedshadow:
+@@ -1141,7 +1143,7 @@ nsLookAndFeel::Init()
+
+ style = gtk_widget_get_style(button);
+ if (style) {
+- sFrameBackground = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);
++ sButtonBackground = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);
+ sFrameOuterLightBorder =
+ GDK_COLOR_TO_NS_RGB(style->light[GTK_STATE_NORMAL]);
+ sFrameInnerDarkBorder =
+@@ -1189,12 +1191,9 @@ nsLookAndFeel::Init()
+ GtkWidget *frame = gtk_frame_new(nullptr);
+ gtk_container_add(GTK_CONTAINER(parent), frame);
+
+- style = gtk_widget_get_style_context(frame);
+- gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color);
+- sFrameBackground = GDK_RGBA_TO_NS_RGBA(color);
+-
+ // TODO GTK3 - update sFrameOuterLightBorder
+ // for GTK_BORDER_STYLE_INSET/OUTSET/GROVE/RIDGE border styles (Bug 978172).
++ style = gtk_widget_get_style_context(frame);
+ gtk_style_context_get_border_color(style, GTK_STATE_FLAG_NORMAL, &color);
+ sFrameInnerDarkBorder = sFrameOuterLightBorder = GDK_RGBA_TO_NS_RGBA(color);
+ #endif
+diff --git widget/gtk/nsLookAndFeel.h widget/gtk/nsLookAndFeel.h
+index be15179..aabbca6 100644
+--- widget/gtk/nsLookAndFeel.h
++++ widget/gtk/nsLookAndFeel.h
+@@ -64,7 +64,7 @@ protected:
+ nscolor sMenuHoverText;
+ nscolor sButtonText;
+ nscolor sButtonHoverText;
+- nscolor sFrameBackground;
++ nscolor sButtonBackground;
+ nscolor sFrameOuterLightBorder;
+ nscolor sFrameInnerDarkBorder;
+ nscolor sOddCellBackground;
More information about the freebsd-gecko
mailing list