Index: chrome/browser/ui/libgtk2ui/gtk2_ui.cc |
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc |
index c9d25bf01e9e97f73b4168472b4b11f73167003c..898c88350adf90f51030499f2e7503ba94a0fb6b 100644 |
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc |
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc |
@@ -8,6 +8,7 @@ |
#include <pango/pango.h> |
#include <set> |
#include <utility> |
+#include <X11/Xcursor/Xcursor.h> |
Lei Zhang
2016/07/11 22:34:56
nit: C headers above C++ headers.
Tom (Use chromium acct)
2016/07/11 22:56:29
Done.
|
#include "base/command_line.h" |
#include "base/debug/leak_annotations.h" |
@@ -49,6 +50,7 @@ |
#include "ui/gfx/image/image_skia_source.h" |
#include "ui/gfx/skbitmap_operations.h" |
#include "ui/gfx/skia_util.h" |
+#include "ui/gfx/x/x11_types.h" |
#include "ui/native_theme/native_theme.h" |
#include "ui/resources/grit/ui_resources.h" |
#include "ui/views/controls/button/blue_button.h" |
@@ -508,9 +510,10 @@ void Gtk2UI::Initialize() { |
G_CALLBACK(OnThemeChanged), |
this); |
- |
LoadGtkValues(); |
+ LoadCursorTheme(); |
+ |
#if defined(ENABLE_BASIC_PRINTING) |
printing::PrintingContextLinux::SetCreatePrintDialogFunction( |
&PrintDialogGtk2::CreatePrintDialog); |
@@ -996,6 +999,19 @@ void Gtk2UI::LoadGtkValues() { |
theme->GetSystemColor(ui::NativeTheme::kColorId_ThrobberWaitingColor); |
} |
+void Gtk2UI::LoadCursorTheme() { |
+ GtkSettings* settings = gtk_settings_get_default(); |
+ |
+ gchar* theme = nullptr; |
+ gint size = 0; |
+ g_object_get(settings, |
+ "gtk-cursor-theme-name", &theme, |
+ "gtk-cursor-theme-size", &size, |
+ nullptr); |
+ XcursorSetTheme(gfx::GetXDisplay(), theme); |
+ XcursorSetDefaultSize(gfx::GetXDisplay(), size); |
+} |
+ |
void Gtk2UI::UpdateMaterialDesignColors() { |
// TODO(varkha): This should be merged back into LoadGtkValues() once Material |
// Design is on unconditionally. |