From 63a6b7d7d73eb8099ad2356f95659ec69e242e43 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Thu, 25 Sep 2014 13:31:32 +0000 Subject: [PATCH] Merge r172958 - [GTK] Selection background is rendered white when unfocused with recent GTK+ https://bugs.webkit.org/show_bug.cgi?id=136251 Reviewed by Martin Robinson. This is due to a change in the GTK+ theme, but because we are not using the right flags to get the selections colors. We should use GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED when focused and GTK_STATE_FLAG_SELECTED when unfocused, instead of GTK_STATE_FLAG_ACTIVE when unfocused. * platform/gtk/RenderThemeGtk3.cpp: (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor): (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor): (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor): (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor): (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor): (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor): (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor): (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor): --- Source/WebCore/ChangeLog | 23 +++++++++++++++++++ .../WebCore/platform/gtk/RenderThemeGtk3.cpp | 16 ++++++------- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 2a0ff426ad88..640e1efbd5fa 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,26 @@ +2014-08-26 Carlos Garcia Campos + + [GTK] Selection background is rendered white when unfocused with recent GTK+ + https://bugs.webkit.org/show_bug.cgi?id=136251 + + Reviewed by Martin Robinson. + + This is due to a change in the GTK+ theme, but because we are not + using the right flags to get the selections colors. We should use + GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED when focused and + GTK_STATE_FLAG_SELECTED when unfocused, instead of + GTK_STATE_FLAG_ACTIVE when unfocused. + + * platform/gtk/RenderThemeGtk3.cpp: + (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor): + (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor): + (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor): + (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor): + (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor): + (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor): + (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor): + (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor): + 2014-09-17 Philippe Normand [GStreamer] Cannot play Vimeo video diff --git a/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp b/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp index 4a9571e4e938..e49f53d706e2 100644 --- a/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp +++ b/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp @@ -935,56 +935,56 @@ GRefPtr getStockSymbolicIconForWidgetType(GType widgetType, const cha Color RenderThemeGtk::platformActiveSelectionBackgroundColor() const { GdkRGBA gdkRGBAColor; - gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_ENTRY), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor); + gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_ENTRY), static_cast(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), &gdkRGBAColor); return gdkRGBAColor; } Color RenderThemeGtk::platformInactiveSelectionBackgroundColor() const { GdkRGBA gdkRGBAColor; - gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_ENTRY), GTK_STATE_FLAG_ACTIVE, &gdkRGBAColor); + gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_ENTRY), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor); return gdkRGBAColor; } Color RenderThemeGtk::platformActiveSelectionForegroundColor() const { GdkRGBA gdkRGBAColor; - gtk_style_context_get_color(getStyleContext(GTK_TYPE_ENTRY), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor); + gtk_style_context_get_color(getStyleContext(GTK_TYPE_ENTRY), static_cast(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), &gdkRGBAColor); return gdkRGBAColor; } Color RenderThemeGtk::platformInactiveSelectionForegroundColor() const { GdkRGBA gdkRGBAColor; - gtk_style_context_get_color(getStyleContext(GTK_TYPE_ENTRY), GTK_STATE_FLAG_ACTIVE, &gdkRGBAColor); + gtk_style_context_get_color(getStyleContext(GTK_TYPE_ENTRY), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor); return gdkRGBAColor; } Color RenderThemeGtk::activeListBoxSelectionBackgroundColor() const { GdkRGBA gdkRGBAColor; - gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_TREE_VIEW), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor); + gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_TREE_VIEW), static_cast(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), &gdkRGBAColor); return gdkRGBAColor; } Color RenderThemeGtk::inactiveListBoxSelectionBackgroundColor() const { GdkRGBA gdkRGBAColor; - gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_TREE_VIEW), GTK_STATE_FLAG_ACTIVE, &gdkRGBAColor); + gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_TREE_VIEW), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor); return gdkRGBAColor; } Color RenderThemeGtk::activeListBoxSelectionForegroundColor() const { GdkRGBA gdkRGBAColor; - gtk_style_context_get_color(getStyleContext(GTK_TYPE_TREE_VIEW), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor); + gtk_style_context_get_color(getStyleContext(GTK_TYPE_TREE_VIEW), static_cast(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), &gdkRGBAColor); return gdkRGBAColor; } Color RenderThemeGtk::inactiveListBoxSelectionForegroundColor() const { GdkRGBA gdkRGBAColor; - gtk_style_context_get_color(getStyleContext(GTK_TYPE_TREE_VIEW), GTK_STATE_FLAG_ACTIVE, &gdkRGBAColor); + gtk_style_context_get_color(getStyleContext(GTK_TYPE_TREE_VIEW), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor); return gdkRGBAColor; }