+/*
+ * returns the number of transients for win, plus the number of transients
+ * associated with each transient of win
+ */
+static int countTransients(const BlackboxWindow * const win) {
+ int ret = win->getTransients().size();
+ if (ret > 0) {
+ BlackboxWindowList::const_iterator it, end = win->getTransients().end();
+ for (it = win->getTransients().begin(); 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().size() == 0) 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) {
+ *stack++ = (*it)->getFrameWindow();
+ screen->updateNetizenWindowRaise((*it)->getClientWindow());
+
+ if (! (*it)->isIconic()) {
+ Workspace *wkspc = screen->getWorkspace((*it)->getWorkspaceNumber());
+ wkspc->stackingList.remove((*it));
+ wkspc->stackingList.push_front((*it));
+ }