Read the default WM from $(datadir)/default.wm rather than using the first

1999-03-02  Martin Baulig  <martin@home-of-linux.org>

	* 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.
This commit is contained in:
Martin Baulig 1999-03-07 14:31:53 +00:00 committed by Martin Baulig
parent 690b6e88f7
commit ee81bac1db
2 changed files with 39 additions and 0 deletions

View file

@ -1,3 +1,9 @@
1999-03-02 Martin Baulig <martin@home-of-linux.org>
* 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 <martin@home-of-linux.org>
* capplets/background-properties/app-background.c: Added some

View file

@ -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;