While the user resizes a window, programmatical resize operations are ignored,
likewise, while the user moves a window around, programmatical moves are ignored as well. This fixes bug #264. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16743 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
32600acb6b
commit
f025cd8b72
@ -1960,9 +1960,10 @@ BWindow::MoveBy(float dx, float dy)
|
||||
fLink->StartMessage(AS_WINDOW_MOVE);
|
||||
fLink->Attach<float>(dx);
|
||||
fLink->Attach<float>(dy);
|
||||
fLink->Flush();
|
||||
|
||||
fFrame.OffsetBy(dx, dy);
|
||||
status_t status;
|
||||
if (fLink->FlushWithReply(status) == B_OK && status == B_OK)
|
||||
fFrame.OffsetBy(dx, dy);
|
||||
|
||||
Unlock();
|
||||
}
|
||||
@ -2016,10 +2017,12 @@ BWindow::ResizeBy(float dx, float dy)
|
||||
fLink->StartMessage(AS_WINDOW_RESIZE);
|
||||
fLink->Attach<float>(dx);
|
||||
fLink->Attach<float>(dy);
|
||||
fLink->Flush();
|
||||
|
||||
fFrame.SetRightBottom(fFrame.RightBottom() + BPoint(dx, dy));
|
||||
_AdoptResize();
|
||||
status_t status;
|
||||
if (fLink->FlushWithReply(status) == B_OK && status == B_OK) {
|
||||
fFrame.SetRightBottom(fFrame.RightBottom() + BPoint(dx, dy));
|
||||
_AdoptResize();
|
||||
}
|
||||
}
|
||||
Unlock();
|
||||
}
|
||||
|
@ -813,7 +813,15 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
STRACE(("ServerWindow %s: Message AS_WINDOW_RESIZE %.1f, %.1f\n",
|
||||
Title(), xResizeBy, yResizeBy));
|
||||
|
||||
fDesktop->ResizeWindowBy(fWindowLayer, xResizeBy, yResizeBy);
|
||||
if (Window()->IsResizing()) {
|
||||
// While the user resizes the window, we ignore
|
||||
// pragmatically set window bounds
|
||||
fLink.StartMessage(B_BUSY);
|
||||
} else {
|
||||
fDesktop->ResizeWindowBy(fWindowLayer, xResizeBy, yResizeBy);
|
||||
fLink.StartMessage(B_OK);
|
||||
}
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
case AS_WINDOW_MOVE:
|
||||
@ -827,7 +835,15 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
STRACE(("ServerWindow %s: Message AS_WINDOW_MOVE: %.1f, %.1f\n",
|
||||
Title(), xMoveBy, yMoveBy));
|
||||
|
||||
fDesktop->MoveWindowBy(fWindowLayer, xMoveBy, yMoveBy);
|
||||
if (Window()->IsDragging()) {
|
||||
// While the user moves the window, we ignore
|
||||
// pragmatically set window positions
|
||||
fLink.StartMessage(B_BUSY);
|
||||
} else {
|
||||
fDesktop->MoveWindowBy(fWindowLayer, xMoveBy, yMoveBy);
|
||||
fLink.StartMessage(B_OK);
|
||||
}
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
case AS_SET_SIZE_LIMITS:
|
||||
|
@ -146,7 +146,9 @@ class WindowLayer {
|
||||
{ fCurrentWorkspace = index; }
|
||||
bool IsVisible() const;
|
||||
|
||||
// TODO: make this int32 stuff
|
||||
bool IsDragging() const { return fIsDragging; }
|
||||
bool IsResizing() const { return fIsResizing; }
|
||||
|
||||
void SetSizeLimits(int32 minWidth, int32 maxWidth,
|
||||
int32 minHeight, int32 maxHeight);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user