From: Dana Jansens Date: Fri, 29 Jul 2011 19:59:22 +0000 (-0400) Subject: Allow client destroy notify functions to be removed based on the data associated... X-Git-Tag: mikabox-3.5-7~70 X-Git-Url: http://git.openbox.org/?p=mikachu%2Fopenbox.git;a=commitdiff_plain;h=52cdea653c9b3a7055bca40e4019f599d9291bb6 Allow client destroy notify functions to be removed based on the data associated with them. --- diff --git a/openbox/client.c b/openbox/client.c index 8634707..07db26b 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -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; diff --git a/openbox/client.h b/openbox/client.h index d5b344f..18c88ec 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -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