aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc20
-rw-r--r--src/Window.cc52
-rw-r--r--src/Window.hh2
3 files changed, 21 insertions, 53 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 07f55c4..e6d10ff 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1113,6 +1113,12 @@ void BScreen::changeWorkspaceID(unsigned int id, bool revert) {
1113 1113
1114 FbTk::App::instance()->sync(false); 1114 FbTk::App::instance()->sync(false);
1115 1115
1116 FluxboxWindow *focused = FocusControl::focusedFbWindow();
1117
1118 if (focused && focused->isMoving() && doOpaqueMove())
1119 // don't reassociate if not opaque moving
1120 reassociateWindow(focused, id, true);
1121
1116 // set new workspace 1122 // set new workspace
1117 Workspace *old = currentWorkspace(); 1123 Workspace *old = currentWorkspace();
1118 m_current_workspace = getWorkspace(id); 1124 m_current_workspace = getWorkspace(id);
@@ -1120,15 +1126,6 @@ void BScreen::changeWorkspaceID(unsigned int id, bool revert) {
1120 // we show new workspace first in order to appear faster 1126 // we show new workspace first in order to appear faster
1121 currentWorkspace()->showAll(); 1127 currentWorkspace()->showAll();
1122 1128
1123 FluxboxWindow *focused = FocusControl::focusedFbWindow();
1124
1125 if (focused && focused->isMoving()) {
1126 if (doOpaqueMove())
1127 reassociateWindow(focused, id, true);
1128 // don't reassociate if not opaque moving
1129 focused->pauseMoving();
1130 }
1131
1132 // reassociate all windows that are stuck to the new workspace 1129 // reassociate all windows that are stuck to the new workspace
1133 Workspace::Windows wins = old->windowList(); 1130 Workspace::Windows wins = old->windowList();
1134 Workspace::Windows::iterator it = wins.begin(); 1131 Workspace::Windows::iterator it = wins.begin();
@@ -1145,10 +1142,9 @@ void BScreen::changeWorkspaceID(unsigned int id, bool revert) {
1145 (*icon_it)->setWorkspace(id); 1142 (*icon_it)->setWorkspace(id);
1146 } 1143 }
1147 1144
1148 if (focused && focused->isMoving()) { 1145 if (focused && focused->isMoving() && doOpaqueMove())
1149 focused->focus(); 1146 focused->focus();
1150 focused->resumeMoving(); 1147 else if (revert)
1151 } else if (revert)
1152 FocusControl::revertFocus(*this); 1148 FocusControl::revertFocus(*this);
1153 1149
1154 old->hideAll(false); 1150 old->hideAll(false);
diff --git a/src/Window.cc b/src/Window.cc
index 8c50f39..e29e761 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -2462,6 +2462,14 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2462 m_last_resize_x = me.x_root; 2462 m_last_resize_x = me.x_root;
2463 m_last_resize_y = me.y_root; 2463 m_last_resize_y = me.y_root;
2464 2464
2465 // undraw rectangle before warping workspaces
2466 if (!screen().doOpaqueMove()) {
2467 parent().drawRectangle(screen().rootTheme()->opGC(),
2468 m_last_move_x, m_last_move_y,
2469 frame().width() + 2*frame().window().borderWidth()-1,
2470 frame().height() + 2*frame().window().borderWidth()-1);
2471 }
2472
2465 if (moved_x && screen().isWorkspaceWarping()) { 2473 if (moved_x && screen().isWorkspaceWarping()) {
2466 unsigned int cur_id = screen().currentWorkspaceID(); 2474 unsigned int cur_id = screen().currentWorkspaceID();
2467 unsigned int new_id = cur_id; 2475 unsigned int new_id = cur_id;
@@ -2492,7 +2500,10 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2492 XWarpPointer(display, None, me.root, 0, 0, 0, 0, 2500 XWarpPointer(display, None, me.root, 0, 0, 0, 0,
2493 m_last_resize_x, m_last_resize_y); 2501 m_last_resize_x, m_last_resize_y);
2494 2502
2495 screen().sendToWorkspace(new_id, this, true); 2503 if (screen().doOpaqueMove())
2504 screen().sendToWorkspace(new_id, this, true);
2505 else
2506 screen().changeWorkspaceID(new_id, false);
2496 } 2507 }
2497 } 2508 }
2498 2509
@@ -2505,12 +2516,7 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2505 // dx = current left side, dy = current top 2516 // dx = current left side, dy = current top
2506 doSnapping(dx, dy); 2517 doSnapping(dx, dy);
2507 2518
2508 if (! screen().doOpaqueMove()) { 2519 if (!screen().doOpaqueMove()) {
2509 parent().drawRectangle(screen().rootTheme()->opGC(),
2510 m_last_move_x, m_last_move_y,
2511 frame().width() + 2*frame().window().borderWidth()-1,
2512 frame().height() + 2*frame().window().borderWidth()-1);
2513
2514 parent().drawRectangle(screen().rootTheme()->opGC(), 2520 parent().drawRectangle(screen().rootTheme()->opGC(),
2515 dx, dy, 2521 dx, dy,
2516 frame().width() + 2*frame().window().borderWidth()-1, 2522 frame().width() + 2*frame().window().borderWidth()-1,
@@ -2874,38 +2880,6 @@ void FluxboxWindow::stopMoving(bool interrupted) {
2874 FbTk::App::instance()->sync(false); //make sure the redraw is made before we continue 2880 FbTk::App::instance()->sync(false); //make sure the redraw is made before we continue
2875} 2881}
2876 2882
2877void FluxboxWindow::pauseMoving() {
2878 if (screen().doOpaqueMove()) {
2879 return;
2880 }
2881
2882 parent().drawRectangle(screen().rootTheme()->opGC(),
2883 m_last_move_x, m_last_move_y,
2884 frame().width() + 2*frame().window().borderWidth()-1,
2885 frame().height() + 2*frame().window().borderWidth()-1);
2886
2887}
2888
2889
2890void FluxboxWindow::resumeMoving() {
2891 if (screen().doOpaqueMove()) {
2892 return;
2893 }
2894
2895 if (m_workspace_number == screen().currentWorkspaceID()) {
2896 frame().show();
2897 focus();
2898 }
2899
2900 FbTk::App::instance()->sync(false);
2901
2902 parent().drawRectangle(screen().rootTheme()->opGC(),
2903 m_last_move_x, m_last_move_y,
2904 frame().width() + 2*frame().window().borderWidth()-1,
2905 frame().height() + 2*frame().window().borderWidth()-1);
2906
2907}
2908
2909/** 2883/**
2910 * Helper function that snaps a window to another window 2884 * Helper function that snaps a window to another window
2911 * We snap if we're closer than the x/ylimits. 2885 * We snap if we're closer than the x/ylimits.
diff --git a/src/Window.hh b/src/Window.hh
index 27901d2..97ece55 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -297,8 +297,6 @@ public:
297 // popup menu on last button press position 297 // popup menu on last button press position
298 void popupMenu(); 298 void popupMenu();
299 299
300 void pauseMoving();
301 void resumeMoving();
302 /** 300 /**
303 @name event handlers 301 @name event handlers
304 */ 302 */