handle xcursor so that we support Xcursor files.

Thu Feb  6 16:43:33 2003  Jonathan Blandford  <jrb@redhat.com>

	* gnome-settings-font.c (load_xcursor_theme): handle xcursor so
	that we support Xcursor files.

	* gnome-settings-daemon.c: move
	gnome_settings_daemon_spawn_with_input here so multiple modules
	can use it.
This commit is contained in:
Jonathan Blandford 2003-02-06 21:47:00 +00:00 committed by Jonathan Blandford
parent e3dd60098a
commit 1f239d9a03
5 changed files with 170 additions and 122 deletions

View file

@ -11,6 +11,34 @@
#include <string.h>
static void
load_xcursor_theme (GConfClient *client)
{
gchar *cursor_theme;
gint size;
char *add[] = { "xrdb", "-merge", NULL };
GString *add_string = g_string_new (NULL);
cursor_theme = gconf_client_get_string (client,
"/desktop/gnome/peripherals/mouse/cursor_theme",
NULL);
size = gconf_client_get_int (client,
"/desktop/gnome/peripherals/mouse/cursor_size",
NULL);
if (cursor_theme == NULL || size <= 0)
return;
g_string_append_printf (add_string,
"Xcursor.theme: %s\n", cursor_theme);
g_string_append (add_string, "Xcursor.theme_core: true\n");
g_string_append_printf (add_string,
"Xcursor.size: %d\n", size);
gnome_settings_daemon_spawn_with_input (add, add_string->str);
g_string_free (add_string, TRUE);
}
static void
load_cursor (GConfClient *client)
{
@ -122,7 +150,9 @@ load_cursor (GConfClient *client)
/* run mkfontdir */
mkfontdir_cmd = g_strdup_printf ("mkfontdir %s %s", dir_name, font_dir_name);
/* maybe check for error... */
/* maybe check for error...
* also, it's not going to like that if there are spaces in dir_name/font_dir_name.
*/
g_spawn_command_line_sync (mkfontdir_cmd, NULL, NULL, NULL, NULL);
g_free (mkfontdir_cmd);
@ -167,7 +197,8 @@ load_cursor (GConfClient *client)
void
gnome_settings_font_init (GConfClient *client)
{
load_cursor (client);
load_xcursor_theme (client);
load_cursor (client);
}
void