make the client destructor a GDestroyNotify

This commit is contained in:
Dana Jansens 2003-09-03 08:10:51 +00:00
parent 2573b51904
commit 5e5fdb1666
4 changed files with 9 additions and 11 deletions

View file

@ -60,12 +60,12 @@ void client_shutdown()
{
}
void client_add_destructor(ObClientDestructorFunc func)
void client_add_destructor(GDestroyNotify func)
{
client_destructors = g_slist_prepend(client_destructors, (gpointer)func);
}
void client_remove_destructor(ObClientDestructorFunc func)
void client_remove_destructor(GDestroyNotify func)
{
client_destructors = g_slist_remove(client_destructors, (gpointer)func);
}
@ -423,7 +423,7 @@ void client_unmanage(ObClient *self)
}
for (it = client_destructors; it; it = g_slist_next(it)) {
ObClientDestructorFunc func = (ObClientDestructorFunc) it->data;
GDestroyNotify func = (GDestroyNotify) it->data;
func(self);
}

View file

@ -243,10 +243,8 @@ extern GList *client_list;
void client_startup();
void client_shutdown();
typedef void (*ObClientDestructorFunc)(ObClient *c);
void client_add_destructor(ObClientDestructorFunc func);
void client_remove_destructor(ObClientDestructorFunc func);
void client_add_destructor(GDestroyNotify func);
void client_remove_destructor(GDestroyNotify func);
/*! Manages all existing windows */
void client_manage_all();

View file

@ -55,11 +55,11 @@ static gboolean menu_open(gchar *file, xmlDocPtr *doc, xmlNodePtr *node)
return loaded;
}
static void client_dest(ObClient *c)
static void client_dest(gpointer client)
{
/* menus can be associated with a client, so close any that are since
we are disappearing now */
menu_frame_hide_all_client(c);
menu_frame_hide_all_client(client);
}
void menu_startup()

View file

@ -28,9 +28,9 @@ static ObCorner lockcorner;
static Popup *popup = NULL;
static void client_dest(ObClient *c)
static void client_dest(gpointer client)
{
if (moveresize_client == c)
if (moveresize_client == client)
moveresize_end(TRUE);
}