if (w->isModal()) w->setModal(False);
if (w->getWorkspaceNumber() != BSENTINEL &&
- w->getWindowNumber() != BSENTINEL)
+ w->getWindowNumber() != BSENTINEL) {
getWorkspace(w->getWorkspaceNumber())->removeWindow(w);
- else if (w->isIconic())
+ if (w->isStuck()) {
+ for (unsigned int i = 0; i < getNumberOfWorkspaces(); ++i)
+ if (i != w->getWorkspaceNumber())
+ getWorkspace(i)->removeWindow(w, True);
+ }
+ } else if (w->isIconic())
removeIcon(w);
if (w->isNormal()) {
if (w->isIconic()) {
removeIcon(w);
getWorkspace(wkspc_id)->addWindow(w);
+ if (w->isStuck())
+ for (unsigned int i = 0; i < getNumberOfWorkspaces(); ++i)
+ if (i != w->getWorkspaceNumber())
+ getWorkspace(i)->addWindow(w, True);
} else if (ignore_sticky || ! w->isStuck()) {
if (w->isStuck())
w->stick();
bool BlackboxWindow::setInputFocus(void) {
if (flags.focused) return True;
- assert(! flags.iconic &&
- (flags.stuck || // window must be on the current workspace or sticky
+ assert((flags.stuck || // window must be on the current workspace or sticky
blackbox_attrib.workspace == screen->getCurrentWorkspaceID()));
/*
setState(IconicState);
screen->getWorkspace(blackbox_attrib.workspace)->removeWindow(this);
+ if (flags.stuck) {
+ for (unsigned int i = 0; i < screen->getNumberOfWorkspaces(); ++i)
+ if (i != blackbox_attrib.workspace)
+ screen->getWorkspace(i)->removeWindow(this, True);
+ }
if (isTransient()) {
if (client.transient_for != (BlackboxWindow *) ~0ul &&
blackbox_attrib.flags ^= AttribOmnipresent;
blackbox_attrib.attrib ^= AttribOmnipresent;
- for (unsigned int i = 0; i < screen->getNumberOfWorkspaces(); ++i)
- if (i != blackbox_attrib.workspace)
- screen->getWorkspace(i)->removeWindow(this, True);
-
flags.stuck = False;
if (! flags.iconic)
raiseWindow(w);
else
lowerWindow(w);
-
- // if the window is sticky, then it needs to be added on all other
- // workspaces too!
- if (! sticky && w->isStuck()) {
- for (unsigned int i = 0; i < screen->getWorkspaceCount(); ++i)
- if (i != id)
- screen->getWorkspace(i)->addWindow(w, place, True);
- }
}
focusFallback(w);
}
- // if the window is sticky, then it needs to be removed on all other
- // workspaces too!
- if (! sticky && w->isStuck()) {
- for (unsigned int i = 0; i < screen->getWorkspaceCount(); ++i)
- if (i != id)
- screen->getWorkspace(i)->removeWindow(w, True);
- }
-
if (! w->isNormal()) return;
BlackboxWindowList::iterator it, end = windowList.end();