X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FWindow.cc;h=6131ec4917b21524ac73a5c1635aa40ed70a5e3e;hb=8e38989ee8533c364a7f407bdafef351d9f1823e;hp=4b730d34396b6e4bf5815ac6e6bf6b5e5ded0dc7;hpb=ba9c665a87fbb18cd850bf5769082bbd6f9e7d7f;p=chaz%2Fopenbox diff --git a/src/Window.cc b/src/Window.cc index 4b730d34..6131ec49 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -361,18 +361,9 @@ BlackboxWindow::~BlackboxWindow(void) { if (client.transient_for != (BlackboxWindow *) ~0ul) { client.transient_for->client.transientList.remove(this); } - // we save our transient_for though because the workspace will use it - // when determining the next window to get focus + client.transient_for = (BlackboxWindow*) 0; } - if (blackbox_attrib.workspace != BSENTINEL && - window_number != BSENTINEL) - screen->getWorkspace(blackbox_attrib.workspace)->removeWindow(this); - else if (flags.iconic) - screen->removeIcon(this); - - client.transient_for = (BlackboxWindow*) 0; - if (client.transientList.size() > 0) { // reset transient_for for all transients BlackboxWindowList::iterator it, end = client.transientList.end(); @@ -2962,55 +2953,57 @@ void BlackboxWindow::doMove(int x_root, int y_root) { dx -= frame.border_w; dy -= frame.border_w; - // workspace warping - bool warp = False; - unsigned int dest = screen->getCurrentWorkspaceID(); - if (x_root <= 0) { - warp = True; + if (screen->doWorkspaceWarping()) { + // workspace warping + bool warp = False; + unsigned int dest = screen->getCurrentWorkspaceID(); + if (x_root <= 0) { + warp = True; - if (dest > 0) dest--; - else dest = screen->getNumberOfWorkspaces() - 1; + if (dest > 0) dest--; + else dest = screen->getNumberOfWorkspaces() - 1; - } else if (x_root >= screen->getRect().right()) { - warp = True; + } else if (x_root >= screen->getRect().right()) { + warp = True; - if (dest < screen->getNumberOfWorkspaces() - 1) dest++; - else dest = 0; - } - if (warp) { - endMove(); - bool focus = flags.focused; // had focus while moving? - if (! flags.stuck) - screen->reassociateWindow(this, dest, False); - screen->changeWorkspaceID(dest); - if (focus) - setInputFocus(); - - /* - If the XWarpPointer is done after the configure, we can end up - grabbing another window, so made sure you do it first. - */ - int dest_x; - if (x_root <= 0) { - dest_x = screen->getRect().right() - 1; - XWarpPointer(blackbox->getXDisplay(), None, - screen->getRootWindow(), 0, 0, 0, 0, - dest_x, y_root); + if (dest < screen->getNumberOfWorkspaces() - 1) dest++; + else dest = 0; + } + if (warp) { + endMove(); + bool focus = flags.focused; // had focus while moving? + if (! flags.stuck) + screen->reassociateWindow(this, dest, False); + screen->changeWorkspaceID(dest); + if (focus) + setInputFocus(); - configure(dx + (screen->getRect().width() - 1), dy, - frame.rect.width(), frame.rect.height()); - } else { - dest_x = 0; - XWarpPointer(blackbox->getXDisplay(), None, - screen->getRootWindow(), 0, 0, 0, 0, - dest_x, y_root); + /* + If the XWarpPointer is done after the configure, we can end up + grabbing another window, so made sure you do it first. + */ + int dest_x; + if (x_root <= 0) { + dest_x = screen->getRect().right() - 1; + XWarpPointer(blackbox->getXDisplay(), None, + screen->getRootWindow(), 0, 0, 0, 0, + dest_x, y_root); + + configure(dx + (screen->getRect().width() - 1), dy, + frame.rect.width(), frame.rect.height()); + } else { + dest_x = 0; + XWarpPointer(blackbox->getXDisplay(), None, + screen->getRootWindow(), 0, 0, 0, 0, + dest_x, y_root); - configure(dx - (screen->getRect().width() - 1), dy, - frame.rect.width(), frame.rect.height()); - } + configure(dx - (screen->getRect().width() - 1), dy, + frame.rect.width(), frame.rect.height()); + } - beginMove(dest_x, y_root); - return; + beginMove(dest_x, y_root); + return; + } } const int snap_distance = screen->getEdgeSnapThreshold();