Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1074)

Unified Diff: chrome/browser/ui/libgtkui/gtk_util.cc

Issue 2627153003: Gtk3: Fix separator color on Gtk3.20 (Closed)
Patch Set: Add GtkVersionCheck Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/libgtkui/gtk_util.h ('k') | chrome/browser/ui/libgtkui/native_theme_gtk3.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtkui/gtk_util.cc
diff --git a/chrome/browser/ui/libgtkui/gtk_util.cc b/chrome/browser/ui/libgtkui/gtk_util.cc
index 633539dfac49f211e723146fe46f184fee9a759c..edd6d3f6de9263e29bafd04f26d8ad2fdf3545ce 100644
--- a/chrome/browser/ui/libgtkui/gtk_util.cc
+++ b/chrome/browser/ui/libgtkui/gtk_util.cc
@@ -201,6 +201,26 @@ void ClearAuraTransientParent(GtkWidget* dialog) {
}
#if GTK_MAJOR_VERSION > 2
+bool GtkVersionCheck(int major, int minor, int micro) {
+ static int actual_major = gtk_get_major_version();
+ if (actual_major > major)
+ return true;
+ else if (actual_major < major)
+ return false;
+
+ static int actual_minor = gtk_get_minor_version();
+ if (actual_minor > minor)
+ return true;
+ else if (actual_minor < minor)
+ return false;
+
+ static int actual_micro = gtk_get_micro_version();
+ if (actual_micro >= micro)
+ return true;
+ else
+ return false;
+}
+
ScopedStyleContext AppendNode(GtkStyleContext* context,
const std::string& css_node) {
GtkWidgetPath* path =
@@ -257,8 +277,7 @@ ScopedStyleContext AppendNode(GtkStyleContext* context,
} else {
switch (part_type) {
case CSS_NAME: {
- if (gtk_get_major_version() > 3 ||
- (gtk_get_major_version() == 3 && gtk_get_minor_version() >= 20)) {
+ if (GtkVersionCheck(3, 20)) {
static auto* _gtk_widget_path_iter_set_object_name =
reinterpret_cast<void (*)(GtkWidgetPath*, gint, const char*)>(
dlsym(GetGtk3SharedLibrary(),
« no previous file with comments | « chrome/browser/ui/libgtkui/gtk_util.h ('k') | chrome/browser/ui/libgtkui/native_theme_gtk3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698