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
=== modified file 'plugins/xsettings/gsd-xsettings-manager.c'
--- plugins/xsettings/gsd-xsettings-manager.c 2015-10-07 15:18:08 +0000
+++ plugins/xsettings/gsd-xsettings-manager.c 2015-10-12 11:36:52 +0000
@@ -63,6 +63,7 @@
63#define TEXT_SCALING_FACTOR_KEY "text-scaling-factor"63#define TEXT_SCALING_FACTOR_KEY "text-scaling-factor"
64#define SCALING_FACTOR_KEY "scaling-factor"64#define SCALING_FACTOR_KEY "scaling-factor"
65#define CURSOR_SIZE_KEY "cursor-size"65#define CURSOR_SIZE_KEY "cursor-size"
66#define CURSOR_THEME_KEY "cursor-theme"
6667
67#define FONT_ANTIALIASING_KEY "antialiasing"68#define FONT_ANTIALIASING_KEY "antialiasing"
68#define FONT_HINTING_KEY "hinting"69#define FONT_HINTING_KEY "hinting"
@@ -498,6 +499,7 @@
498 int dpi;499 int dpi;
499 int window_scale;500 int window_scale;
500 int cursor_size;501 int cursor_size;
502 gchar *cursor_theme;
501 const char *rgba;503 const char *rgba;
502 const char *hintstyle;504 const char *hintstyle;
503} GnomeXftSettings;505} GnomeXftSettings;
@@ -529,6 +531,7 @@
529 settings->scaled_dpi = dpi * settings->window_scale * 1024;531 settings->scaled_dpi = dpi * settings->window_scale * 1024;
530 cursor_size = g_settings_get_int (interface_settings, CURSOR_SIZE_KEY);532 cursor_size = g_settings_get_int (interface_settings, CURSOR_SIZE_KEY);
531 settings->cursor_size = cursor_size * settings->window_scale;533 settings->cursor_size = cursor_size * settings->window_scale;
534 settings->cursor_theme = g_settings_get_string (interface_settings, CURSOR_THEME_KEY);
532 settings->rgba = "rgb";535 settings->rgba = "rgb";
533 settings->hintstyle = "hintfull";536 settings->hintstyle = "hintfull";
534537
@@ -583,6 +586,12 @@
583}586}
584587
585static void588static void
589xft_settings_clear (GnomeXftSettings *settings)
590{
591 g_free (settings->cursor_theme);
592}
593
594static void
586xft_settings_set_xsettings (GnomeXSettingsManager *manager,595xft_settings_set_xsettings (GnomeXSettingsManager *manager,
587 GnomeXftSettings *settings)596 GnomeXftSettings *settings)
588{597{
@@ -599,6 +608,7 @@
599 xsettings_manager_set_int (manager->priv->managers [i], "Xft/DPI", settings->scaled_dpi);608 xsettings_manager_set_int (manager->priv->managers [i], "Xft/DPI", settings->scaled_dpi);
600 xsettings_manager_set_string (manager->priv->managers [i], "Xft/RGBA", settings->rgba);609 xsettings_manager_set_string (manager->priv->managers [i], "Xft/RGBA", settings->rgba);
601 xsettings_manager_set_int (manager->priv->managers [i], "Gtk/CursorThemeSize", settings->cursor_size);610 xsettings_manager_set_int (manager->priv->managers [i], "Gtk/CursorThemeSize", settings->cursor_size);
611 xsettings_manager_set_string (manager->priv->managers [i], "Gtk/CursorThemeName", settings->cursor_theme);
602 }612 }
603 gnome_settings_profile_end (NULL);613 gnome_settings_profile_end (NULL);
604}614}
@@ -662,6 +672,8 @@
662 settings->rgba);672 settings->rgba);
663 update_property (add_string, "Xcursor.size",673 update_property (add_string, "Xcursor.size",
664 g_ascii_dtostr (dpibuf, sizeof (dpibuf), (double) settings->cursor_size));674 g_ascii_dtostr (dpibuf, sizeof (dpibuf), (double) settings->cursor_size));
675 update_property (add_string, "Xcursor.theme",
676 settings->cursor_theme);
665677
666 g_debug("xft_settings_set_xresources: new res '%s'", add_string->str);678 g_debug("xft_settings_set_xresources: new res '%s'", add_string->str);
667679
@@ -688,6 +700,7 @@
688 xft_settings_get (manager, &settings);700 xft_settings_get (manager, &settings);
689 xft_settings_set_xsettings (manager, &settings);701 xft_settings_set_xsettings (manager, &settings);
690 xft_settings_set_xresources (&settings);702 xft_settings_set_xresources (&settings);
703 xft_settings_clear (&settings);
691704
692 gnome_settings_profile_end (NULL);705 gnome_settings_profile_end (NULL);
693}706}
@@ -913,7 +926,8 @@
913926
914 if (g_str_equal (key, TEXT_SCALING_FACTOR_KEY) ||927 if (g_str_equal (key, TEXT_SCALING_FACTOR_KEY) ||
915 g_str_equal (key, SCALING_FACTOR_KEY) ||928 g_str_equal (key, SCALING_FACTOR_KEY) ||
916 g_str_equal (key, CURSOR_SIZE_KEY)) {929 g_str_equal (key, CURSOR_SIZE_KEY) ||
930 g_str_equal (key, CURSOR_THEME_KEY)) {
917 xft_callback (NULL, key, manager);931 xft_callback (NULL, key, manager);
918 return;932 return;
919 }933 }

Subscribers

People subscribed via source and target branches