diff options
Diffstat (limited to 'capplets/appearance')
-rw-r--r-- | capplets/appearance/appearance-main.c | 2 | ||||
-rw-r--r-- | capplets/appearance/appearance-support.c | 32 | ||||
-rw-r--r-- | capplets/appearance/appearance-themes.c | 6 |
3 files changed, 30 insertions, 10 deletions
diff --git a/capplets/appearance/appearance-main.c b/capplets/appearance/appearance-main.c index 65e703ad..b16b76fe 100644 --- a/capplets/appearance/appearance-main.c +++ b/capplets/appearance/appearance-main.c @@ -38,7 +38,9 @@ init_appearance_data (int *argc, char ***argv, GOptionContext *context) GtkBuilder *ui; GError *err = NULL; +#if !GLIB_CHECK_VERSION (2, 32, 0) g_thread_init (NULL); +#endif gdk_threads_init (); gdk_threads_enter (); theme_thumbnail_factory_init (*argc, *argv); diff --git a/capplets/appearance/appearance-support.c b/capplets/appearance/appearance-support.c index 42b906cc..25cc003c 100644 --- a/capplets/appearance/appearance-support.c +++ b/capplets/appearance/appearance-support.c @@ -57,21 +57,34 @@ metacity_is_running() } static void -metacity_theme_apply(const gchar *theme) +metacity_theme_apply(const gchar *theme, const gchar *font) { /* set theme, we use gconf and gsettings binaries to avoid schemas and versions issues */ if (is_program_in_path ("gconftool-2")) { - gchar *gconf_cmd = g_strdup_printf("gconftool-2 --set --type string /apps/metacity/general/theme '%s'", theme); + gchar *gconf_cmd = NULL; + + gconf_cmd = g_strdup_printf("gconftool-2 --set --type string /apps/metacity/general/theme '%s'", theme); + g_spawn_command_line_async (gconf_cmd, NULL); + g_free (gconf_cmd); + + gconf_cmd = g_strdup_printf("gconftool-2 --set --type string /apps/metacity/general/titlebar_font '%s'", font); g_spawn_command_line_async (gconf_cmd, NULL); g_free (gconf_cmd); } if (is_program_in_path ("gsettings")) { - gchar *gsettings_cmd = g_strdup_printf("gsettings set org.gnome.desktop.wm.preferences theme '%s'", theme); + gchar *gsettings_cmd = NULL; + + gsettings_cmd = g_strdup_printf("gsettings set org.gnome.desktop.wm.preferences theme '%s'", theme); g_spawn_command_line_async (gsettings_cmd, NULL); g_free (gsettings_cmd); + + gsettings_cmd = g_strdup_printf("gsettings set org.gnome.desktop.wm.preferences titlebar-font '%s'", font); + g_spawn_command_line_async (gsettings_cmd, NULL); + g_free (gsettings_cmd); + } } @@ -79,11 +92,14 @@ static void marco_theme_changed(GSettings *settings, gchar *key, AppearanceData* data) { gchar *theme = NULL; + gchar *font = NULL; if (metacity_is_running ()) { - theme = g_settings_get_string (settings, key); - metacity_theme_apply (theme); + theme = g_settings_get_string (settings, MARCO_THEME_KEY); + font = g_settings_get_string (settings, WINDOW_TITLE_FONT_KEY); + metacity_theme_apply (theme, font); g_free (theme); + g_free (font); } } @@ -92,12 +108,14 @@ support_init(AppearanceData* data) { /* needed for wm_common_get_current_window_manager() */ wm_common_update_window (); - /* GSettings signal */ + /* GSettings signals */ g_signal_connect (data->marco_settings, "changed::" MARCO_THEME_KEY, G_CALLBACK (marco_theme_changed), data); + g_signal_connect (data->marco_settings, "changed::" WINDOW_TITLE_FONT_KEY, + G_CALLBACK (marco_theme_changed), data); /* apply theme at start */ if (metacity_is_running ()) - marco_theme_changed (data->marco_settings, MARCO_THEME_KEY, data); + marco_theme_changed (data->marco_settings, NULL, data); } void diff --git a/capplets/appearance/appearance-themes.c b/capplets/appearance/appearance-themes.c index 57c175cd..b2dfbb1b 100644 --- a/capplets/appearance/appearance-themes.c +++ b/capplets/appearance/appearance-themes.c @@ -209,7 +209,7 @@ theme_load_from_gsettings (AppearanceData *data) theme->gtk_theme_name = g_settings_get_string (data->interface_settings, GTK_THEME_KEY); if (theme->gtk_theme_name == NULL) - theme->gtk_theme_name = g_strdup ("Clearlooks"); + theme->gtk_theme_name = g_strdup ("Menta"); scheme = g_settings_get_string (data->interface_settings, COLOR_SCHEME_KEY); if (scheme == NULL || !strcmp (scheme, "")) { @@ -220,11 +220,11 @@ theme_load_from_gsettings (AppearanceData *data) theme->marco_theme_name = g_settings_get_string (data->marco_settings, MARCO_THEME_KEY); if (theme->marco_theme_name == NULL) - theme->marco_theme_name = g_strdup ("Clearlooks"); + theme->marco_theme_name = g_strdup ("Menta"); theme->icon_theme_name = g_settings_get_string (data->interface_settings, ICON_THEME_KEY); if (theme->icon_theme_name == NULL) - theme->icon_theme_name = g_strdup ("mate"); + theme->icon_theme_name = g_strdup ("menta"); /* We need this because mate-control-center does not depend on mate-notification-daemon, * and if we try to get notification theme without schema installed, gsettings crashes |