+ old = self->desktop;
+ self->desktop = target;
+ PROP_SET32(self->window, net_wm_desktop, cardinal, target);
+ /* the frame can display the current desktop state */
+ frame_adjust_state(self->frame);
+ /* 'move' the window to the new desktop */
+ if (!donthide)
+ client_showhide(self);
+ /* raise if it was not already on the desktop */
+ if (old != DESKTOP_ALL)
+ stacking_raise(CLIENT_AS_WINDOW(self));
+ screen_update_areas();
+
+ /* add to the new desktop(s) */
+ if (config_focus_new)
+ focus_order_to_top(self);
+ else
+ focus_order_to_bottom(self);
+
+ dispatch_client(Event_Client_Desktop, self, target, old);
+ }
+
+ /* move all transients */
+ for (it = self->transients; it != NULL; it = it->next)
+ if (it->data != self) client_set_desktop_recursive(it->data,
+ target, donthide);
+}
+
+void client_set_desktop(Client *self, guint target, gboolean donthide)
+{
+ client_set_desktop_recursive(client_search_top_transient(self),
+ target, donthide);