+
+void action_add_desktop(union ActionData *data)
+{
+ screen_set_num_desktops(screen_num_desktops+1);
+
+ /* move all the clients over */
+ if (data->addremovedesktop.current) {
+ GList *it;
+
+ for (it = client_list; it; it = g_list_next(it)) {
+ ObClient *c = it->data;
+ if (c->desktop != DESKTOP_ALL && c->desktop >= screen_desktop)
+ client_set_desktop(c, c->desktop+1, FALSE, TRUE);
+ }
+ }
+}
+
+void action_remove_desktop(union ActionData *data)
+{
+ if (screen_num_desktops < 2) return;
+
+ /* move all the clients over */
+ if (data->addremovedesktop.current) {
+ GList *it;
+
+ for (it = client_list; it; it = g_list_next(it)) {
+ ObClient *c = it->data;
+ if (c->desktop != DESKTOP_ALL && c->desktop > screen_desktop)
+ client_set_desktop(c, c->desktop-1, FALSE, TRUE);
+ }
+ }
+
+ screen_set_num_desktops(screen_num_desktops-1);
+}