Allow client destroy notify functions to be removed based on the data associated with them.

This commit is contained in:
Dana Jansens 2011-07-29 15:59:22 -04:00
parent 34b332c22a
commit 52cdea653c
2 changed files with 16 additions and 0 deletions

View file

@ -167,6 +167,21 @@ void client_remove_destroy_notify(ObClientCallback func)
}
}
void client_remove_destroy_notify_data(ObClientCallback func, gpointer data)
{
GSList *it;
for (it = client_destroy_notifies; it; it = g_slist_next(it)) {
ClientCallback *d = it->data;
if (d->func == func && d->data == data) {
g_slice_free(ClientCallback, d);
client_destroy_notifies =
g_slist_delete_link(client_destroy_notifies, it);
break;
}
}
}
void client_set_list(void)
{
Window *windows, *win_it;

View file

@ -326,6 +326,7 @@ typedef void (*ObClientCallback)(ObClient *client, gpointer data);
/*! Get notified when the client is unmanaged */
void client_add_destroy_notify(ObClientCallback func, gpointer data);
void client_remove_destroy_notify(ObClientCallback func);
void client_remove_destroy_notify_data(ObClientCallback func, gpointer data);
/*! Manages a given window
@param prompt This specifies an ObPrompt which is being managed. It is