summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-04-30 08:09:53 +0000
committerDana Jansens <danakj@orodu.net>2002-04-30 08:09:53 +0000
commit0be1c1e8d72f5c5d8ef73c5c6a924e1f540a205a (patch)
tree5cd5eb7b42fde79c401763ce3aa4d9ba72d24d46
parentf4d29bb737631dfd085646283b7620ef863303bf (diff)
when a window begins moving, make sure another window is not moving already, and if it is, end its move
-rw-r--r--src/Window.cc12
-rw-r--r--src/openbox.h2
2 files changed, 8 insertions, 6 deletions
diff --git a/src/Window.cc b/src/Window.cc
index c8c3760b..f722902a 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1472,12 +1472,6 @@ void OpenboxWindow::deiconify(bool reassoc, bool raise, bool initial) {
// after the window is mapped, we need to start interactively moving it
if (initial && place_window &&
screen->placementPolicy() == BScreen::ClickMousePlacement) {
- // if the last window wasn't placed yet, or we're just moving a window
- // already, finish off that move cleanly
- OpenboxWindow *w = openbox.getFocusedWindow();
- if (w != (OpenboxWindow *) 0 && w->flags.moving)
- w->endMove();
-
int x, y, rx, ry;
Window c, r;
unsigned int m;
@@ -2759,6 +2753,12 @@ void OpenboxWindow::buttonReleaseEvent(XButtonEvent *re) {
void OpenboxWindow::startMove(int x, int y) {
ASSERT(!flags.moving);
+ // make sure only one window is moving at a time
+ OpenboxWindow *w;
+ if ((w = openbox.getMaskedWindow()) != (OpenboxWindow *) 0 &&
+ w->flags.moving)
+ w->endMove();
+
XGrabPointer(display, frame.window, False, PointerMotionMask |
ButtonReleaseMask, GrabModeAsync, GrabModeAsync,
None, openbox.getMoveCursor(), CurrentTime);
diff --git a/src/openbox.h b/src/openbox.h
index eae8bcff..8135a329 100644
--- a/src/openbox.h
+++ b/src/openbox.h
@@ -172,6 +172,8 @@ public:
inline const unsigned long &getCacheMax() const
{ return resource.cache_max; }
+ inline OpenboxWindow *getMaskedWindow() const
+ { return masked_window; }
inline void maskWindowEvents(Window w, OpenboxWindow *bw)
{ masked = w; masked_window = bw; }
inline void setNoFocus(Bool f) { no_focus = f; }