diff --git a/ChangeLog b/ChangeLog index 8ed9b51f8..4742c13ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1999-03-02 Martin Baulig + + * capplets/wm-properties/wm-list.c (wm_list_init): Read the + default WM from $(datadir)/default.wm rather than using the + first one from the list. + 1999-02-28 Martin Baulig * capplets/background-properties/app-background.c: Added some diff --git a/capplets/wm-properties/wm-list.c b/capplets/wm-properties/wm-list.c index 5f5c4716e..0e4804247 100644 --- a/capplets/wm-properties/wm-list.c +++ b/capplets/wm-properties/wm-list.c @@ -113,6 +113,23 @@ wm_list_find (GList *list, gchar *name) return NULL; } +static WindowManager * +wm_list_find_exec (GList *list, gchar *name) +{ + GList *tmp_list = list; + while (tmp_list) { + WindowManager *wm = tmp_list->data; + if (!wm->dentry->exec || !wm->dentry->exec[0]) + continue; + if (strcmp (wm->dentry->exec[0], name) == 0) + return wm; + + tmp_list = tmp_list->next; + } + + return NULL; +} + static GList * wm_list_find_files (gchar *directory) { @@ -224,6 +241,22 @@ wm_list_init (void) g_free (name); } + if (!current_wm) { + gchar *wmfile, *prefix; + + wmfile = gnome_unconditional_datadir_file ("default.wm"); + prefix = g_strconcat ("=", wmfile, "=/Default/WM", NULL); + name = gnome_config_get_string (prefix); + + g_free (wmfile); + g_free (prefix); + + if (name) { + current_wm = wm_list_find_exec (window_managers, name); + g_free (name); + } + } + if (!current_wm && window_managers) current_wm = window_managers->data;