Clean the APIs a little bit, add a mechanism for discovering if two

2002-06-04  Seth Nickell  <snickell@stanford.edu>

	* gnome-window-manager.c: (gnome_window_manager_get_ditem):
	* gnome-window-manager.h:
	* gnome-wm-manager.c: (gnome_wm_manager_set_current),
	(gnome_wm_manager_get_current), (gnome_wm_manager_same_wm):
	* gnome-wm-manager.h:

	Clean the APIs a little bit, add a mechanism for discovering if two GnomeWindowManager *s are
	the same Window Manager underneath.
This commit is contained in:
Seth Nickell 2002-06-04 23:00:19 +00:00 committed by Seth Nickell
parent 059bd84cef
commit 07624890ea
5 changed files with 54 additions and 10 deletions

View file

@ -68,13 +68,14 @@ gnome_wm_manager_get_list (void)
void
gnome_wm_manager_set_current (GnomeWindowManager *wm)
{
/*selected_wm = wm->ditem;*/
/* this line is bogus */
/*selected_wm = gnome_window_manager_get_ditem (wm);*/
}
GnomeWindowManager *
gnome_wm_manager_get_current (void)
{
return gnome_window_manager_new (wm_list_get_current()->dentry);
return GNOME_WINDOW_MANAGER (gnome_window_manager_new (wm_list_get_current()->dentry));
}
void gnome_wm_manager_change_wm_to_settings (void)
@ -86,6 +87,26 @@ void gnome_wm_manager_change_wm_to_settings (void)
update_session ();
}
gboolean
gnome_wm_manager_same_wm (GnomeWindowManager *wm1, GnomeWindowManager *wm2)
{
GnomeDesktopItem *item1, *item2;
const char *location1, *location2;
gboolean same;
item1 = gnome_window_manager_get_ditem (wm1);
item2 = gnome_window_manager_get_ditem (wm2);
location1 = gnome_desktop_item_get_location (item1);
location2 = gnome_desktop_item_get_location (item2);
same = (strcmp (location1, location2) == 0);
gnome_desktop_item_unref (item1);
gnome_desktop_item_unref (item2);
return same;
}
static GtkWidget *restart_dialog = NULL;
static GtkWidget *restart_label = NULL;