Merge lp:~3v1n0/unity-settings-daemon/export-xcursor-theme into lp:unity-settings-daemon

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 4109
Merged at revision: 4108
Proposed branch: lp:~3v1n0/unity-settings-daemon/export-xcursor-theme
Merge into: lp:unity-settings-daemon
Diff against target: 75 lines (+15/-1)
1 file modified
plugins/xsettings/gsd-xsettings-manager.c (+15/-1)
To merge this branch: bzr merge lp:~3v1n0/unity-settings-daemon/export-xcursor-theme
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Review via email: mp+274128@code.launchpad.net

Commit message

xsettings: Export cursor theme on X RESOURCE_MANAGER and notify X on changes

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

looks fine, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/xsettings/gsd-xsettings-manager.c'
2--- plugins/xsettings/gsd-xsettings-manager.c 2015-10-07 15:18:08 +0000
3+++ plugins/xsettings/gsd-xsettings-manager.c 2015-10-12 11:36:52 +0000
4@@ -63,6 +63,7 @@
5 #define TEXT_SCALING_FACTOR_KEY "text-scaling-factor"
6 #define SCALING_FACTOR_KEY "scaling-factor"
7 #define CURSOR_SIZE_KEY "cursor-size"
8+#define CURSOR_THEME_KEY "cursor-theme"
9
10 #define FONT_ANTIALIASING_KEY "antialiasing"
11 #define FONT_HINTING_KEY "hinting"
12@@ -498,6 +499,7 @@
13 int dpi;
14 int window_scale;
15 int cursor_size;
16+ gchar *cursor_theme;
17 const char *rgba;
18 const char *hintstyle;
19 } GnomeXftSettings;
20@@ -529,6 +531,7 @@
21 settings->scaled_dpi = dpi * settings->window_scale * 1024;
22 cursor_size = g_settings_get_int (interface_settings, CURSOR_SIZE_KEY);
23 settings->cursor_size = cursor_size * settings->window_scale;
24+ settings->cursor_theme = g_settings_get_string (interface_settings, CURSOR_THEME_KEY);
25 settings->rgba = "rgb";
26 settings->hintstyle = "hintfull";
27
28@@ -583,6 +586,12 @@
29 }
30
31 static void
32+xft_settings_clear (GnomeXftSettings *settings)
33+{
34+ g_free (settings->cursor_theme);
35+}
36+
37+static void
38 xft_settings_set_xsettings (GnomeXSettingsManager *manager,
39 GnomeXftSettings *settings)
40 {
41@@ -599,6 +608,7 @@
42 xsettings_manager_set_int (manager->priv->managers [i], "Xft/DPI", settings->scaled_dpi);
43 xsettings_manager_set_string (manager->priv->managers [i], "Xft/RGBA", settings->rgba);
44 xsettings_manager_set_int (manager->priv->managers [i], "Gtk/CursorThemeSize", settings->cursor_size);
45+ xsettings_manager_set_string (manager->priv->managers [i], "Gtk/CursorThemeName", settings->cursor_theme);
46 }
47 gnome_settings_profile_end (NULL);
48 }
49@@ -662,6 +672,8 @@
50 settings->rgba);
51 update_property (add_string, "Xcursor.size",
52 g_ascii_dtostr (dpibuf, sizeof (dpibuf), (double) settings->cursor_size));
53+ update_property (add_string, "Xcursor.theme",
54+ settings->cursor_theme);
55
56 g_debug("xft_settings_set_xresources: new res '%s'", add_string->str);
57
58@@ -688,6 +700,7 @@
59 xft_settings_get (manager, &settings);
60 xft_settings_set_xsettings (manager, &settings);
61 xft_settings_set_xresources (&settings);
62+ xft_settings_clear (&settings);
63
64 gnome_settings_profile_end (NULL);
65 }
66@@ -913,7 +926,8 @@
67
68 if (g_str_equal (key, TEXT_SCALING_FACTOR_KEY) ||
69 g_str_equal (key, SCALING_FACTOR_KEY) ||
70- g_str_equal (key, CURSOR_SIZE_KEY)) {
71+ g_str_equal (key, CURSOR_SIZE_KEY) ||
72+ g_str_equal (key, CURSOR_THEME_KEY)) {
73 xft_callback (NULL, key, manager);
74 return;
75 }

Subscribers

People subscribed via source and target branches