+static void self_execute(ObMenuEntry *self, ObMenuFrame *f,
+ ObClient *c, guint state, gpointer data)
+{
+ if (self->id == ADD_DESKTOP) {
+ screen_add_desktop(FALSE);
+ menu_frame_hide_all();
+ }
+ else if (self->id == REMOVE_DESKTOP) {
+ screen_remove_desktop(FALSE);
+ menu_frame_hide_all();
+ }
+}
+
+static void client_dest(ObClient *client, gpointer data)
+{
+ /* This concise function removes all references to a closed
+ * client in the client_list_menu, so we don't have to check
+ * in client.c */
+ GSList *it;
+ for (it = desktop_menus; it; it = g_slist_next(it)) {
+ ObMenu *mit = it->data;
+ GList *eit;
+ for (eit = mit->entries; eit; eit = g_list_next(eit)) {
+ ObMenuEntry *meit = eit->data;
+ if (meit->type == OB_MENU_ENTRY_TYPE_NORMAL &&
+ meit->data.normal.data == client)
+ {
+ meit->data.normal.data = NULL;
+ }
+ }
+ }
+}
+
+void client_list_menu_startup(gboolean reconfig)