don't show window on new workspace when warping with outline moving

This commit is contained in:
Mark Tiefenbruck 2008-10-08 17:15:53 -07:00
parent 706ec5c262
commit f3bd8e7565
3 changed files with 21 additions and 53 deletions

View file

@ -1113,6 +1113,12 @@ void BScreen::changeWorkspaceID(unsigned int id, bool revert) {
FbTk::App::instance()->sync(false); FbTk::App::instance()->sync(false);
FluxboxWindow *focused = FocusControl::focusedFbWindow();
if (focused && focused->isMoving() && doOpaqueMove())
// don't reassociate if not opaque moving
reassociateWindow(focused, id, true);
// set new workspace // set new workspace
Workspace *old = currentWorkspace(); Workspace *old = currentWorkspace();
m_current_workspace = getWorkspace(id); m_current_workspace = getWorkspace(id);
@ -1120,15 +1126,6 @@ void BScreen::changeWorkspaceID(unsigned int id, bool revert) {
// we show new workspace first in order to appear faster // we show new workspace first in order to appear faster
currentWorkspace()->showAll(); currentWorkspace()->showAll();
FluxboxWindow *focused = FocusControl::focusedFbWindow();
if (focused && focused->isMoving()) {
if (doOpaqueMove())
reassociateWindow(focused, id, true);
// don't reassociate if not opaque moving
focused->pauseMoving();
}
// reassociate all windows that are stuck to the new workspace // reassociate all windows that are stuck to the new workspace
Workspace::Windows wins = old->windowList(); Workspace::Windows wins = old->windowList();
Workspace::Windows::iterator it = wins.begin(); Workspace::Windows::iterator it = wins.begin();
@ -1145,10 +1142,9 @@ void BScreen::changeWorkspaceID(unsigned int id, bool revert) {
(*icon_it)->setWorkspace(id); (*icon_it)->setWorkspace(id);
} }
if (focused && focused->isMoving()) { if (focused && focused->isMoving() && doOpaqueMove())
focused->focus(); focused->focus();
focused->resumeMoving(); else if (revert)
} else if (revert)
FocusControl::revertFocus(*this); FocusControl::revertFocus(*this);
old->hideAll(false); old->hideAll(false);

View file

@ -2462,6 +2462,14 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
m_last_resize_x = me.x_root; m_last_resize_x = me.x_root;
m_last_resize_y = me.y_root; m_last_resize_y = me.y_root;
// undraw rectangle before warping workspaces
if (!screen().doOpaqueMove()) {
parent().drawRectangle(screen().rootTheme()->opGC(),
m_last_move_x, m_last_move_y,
frame().width() + 2*frame().window().borderWidth()-1,
frame().height() + 2*frame().window().borderWidth()-1);
}
if (moved_x && screen().isWorkspaceWarping()) { if (moved_x && screen().isWorkspaceWarping()) {
unsigned int cur_id = screen().currentWorkspaceID(); unsigned int cur_id = screen().currentWorkspaceID();
unsigned int new_id = cur_id; unsigned int new_id = cur_id;
@ -2492,7 +2500,10 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
XWarpPointer(display, None, me.root, 0, 0, 0, 0, XWarpPointer(display, None, me.root, 0, 0, 0, 0,
m_last_resize_x, m_last_resize_y); m_last_resize_x, m_last_resize_y);
if (screen().doOpaqueMove())
screen().sendToWorkspace(new_id, this, true); screen().sendToWorkspace(new_id, this, true);
else
screen().changeWorkspaceID(new_id, false);
} }
} }
@ -2505,12 +2516,7 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
// dx = current left side, dy = current top // dx = current left side, dy = current top
doSnapping(dx, dy); doSnapping(dx, dy);
if (! screen().doOpaqueMove()) { if (!screen().doOpaqueMove()) {
parent().drawRectangle(screen().rootTheme()->opGC(),
m_last_move_x, m_last_move_y,
frame().width() + 2*frame().window().borderWidth()-1,
frame().height() + 2*frame().window().borderWidth()-1);
parent().drawRectangle(screen().rootTheme()->opGC(), parent().drawRectangle(screen().rootTheme()->opGC(),
dx, dy, dx, dy,
frame().width() + 2*frame().window().borderWidth()-1, frame().width() + 2*frame().window().borderWidth()-1,
@ -2874,38 +2880,6 @@ void FluxboxWindow::stopMoving(bool interrupted) {
FbTk::App::instance()->sync(false); //make sure the redraw is made before we continue FbTk::App::instance()->sync(false); //make sure the redraw is made before we continue
} }
void FluxboxWindow::pauseMoving() {
if (screen().doOpaqueMove()) {
return;
}
parent().drawRectangle(screen().rootTheme()->opGC(),
m_last_move_x, m_last_move_y,
frame().width() + 2*frame().window().borderWidth()-1,
frame().height() + 2*frame().window().borderWidth()-1);
}
void FluxboxWindow::resumeMoving() {
if (screen().doOpaqueMove()) {
return;
}
if (m_workspace_number == screen().currentWorkspaceID()) {
frame().show();
focus();
}
FbTk::App::instance()->sync(false);
parent().drawRectangle(screen().rootTheme()->opGC(),
m_last_move_x, m_last_move_y,
frame().width() + 2*frame().window().borderWidth()-1,
frame().height() + 2*frame().window().borderWidth()-1);
}
/** /**
* Helper function that snaps a window to another window * Helper function that snaps a window to another window
* We snap if we're closer than the x/ylimits. * We snap if we're closer than the x/ylimits.

View file

@ -297,8 +297,6 @@ public:
// popup menu on last button press position // popup menu on last button press position
void popupMenu(); void popupMenu();
void pauseMoving();
void resumeMoving();
/** /**
@name event handlers @name event handlers
*/ */