+ while (! windowList.empty())
+ windowList.front()->iconify();
+}
+
+
+/*
+ * returns the number of transients for win, plus the number of transients
+ * associated with each transient of win
+ */
+static unsigned int countTransients(const BlackboxWindow * const win) {
+ BlackboxWindowList transients = win->getTransients();
+ if (transients.empty()) return 0;
+
+ unsigned int ret = transients.size();
+ BlackboxWindowList::const_iterator it = transients.begin(),
+ end = transients.end();
+ for (; it != end; ++it)
+ ret += countTransients(*it);
+
+ return ret;
+}
+
+
+/*
+ * puts the transients of win into the stack. windows are stacked above
+ * the window before it in the stackvector being iterated, meaning
+ * stack[0] is on bottom, stack[1] is above stack[0], stack[2] is above
+ * stack[1], etc...
+ */
+void Workspace::raiseTransients(const BlackboxWindow * const win,
+ StackVector::iterator &stack) {
+ if (win->getTransients().empty()) return; // nothing to do
+
+ // put win's transients in the stack
+ BlackboxWindowList::const_iterator it, end = win->getTransients().end();
+ for (it = win->getTransients().begin(); it != end; ++it) {
+ BlackboxWindow *w = *it;
+ *stack++ = w->getFrameWindow();
+ screen->updateNetizenWindowRaise(w->getClientWindow());
+
+ if (! w->isIconic()) {
+ Workspace *wkspc = screen->getWorkspace(w->getWorkspaceNumber());
+ wkspc->stackingList.remove(w);
+ wkspc->stackingList.push_front(w);
+ }
+ }
+
+ // put transients of win's transients in the stack
+ for (it = win->getTransients().begin(); it != end; ++it)
+ raiseTransients(*it, stack);