* Reworked the code that ignores a little jitter in mouse movements when
trying to switch the workspace. Not sure why it didn't behave previously, but it seems to work fine now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29514 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
7aed1511f6
commit
dd169d9e23
@ -547,14 +547,19 @@ WorkspacesView::MouseMoved(BMessage* message, BPoint where)
|
||||
if (fSelectedWorkspace == Window()->Desktop()->CurrentWorkspace())
|
||||
leftTop = fSelectedWindow->Frame().LeftTop();
|
||||
else {
|
||||
if (fSelectedWindow->Anchor(fSelectedWorkspace).position == kInvalidWindowPosition)
|
||||
fSelectedWindow->Anchor(fSelectedWorkspace).position = fSelectedWindow->Frame().LeftTop();
|
||||
if (fSelectedWindow->Anchor(fSelectedWorkspace).position
|
||||
== kInvalidWindowPosition) {
|
||||
fSelectedWindow->Anchor(fSelectedWorkspace).position
|
||||
= fSelectedWindow->Frame().LeftTop();
|
||||
}
|
||||
leftTop = fSelectedWindow->Anchor(fSelectedWorkspace).position;
|
||||
}
|
||||
|
||||
float diff = (fClickPoint.x - where.x) * (fClickPoint.x - where.x)
|
||||
+ (fClickPoint.y - where.y) * (fClickPoint.y - where.y);
|
||||
if (!fHasMoved && diff > 4)
|
||||
// Don't treat every little mouse move as a window move - this would
|
||||
// make it too hard to activate a workspace.
|
||||
float diff = max(fabs(fClickPoint.x - where.x),
|
||||
fabs(fClickPoint.y - where.y));
|
||||
if (!fHasMoved && diff > 2)
|
||||
fHasMoved = true;
|
||||
|
||||
if (fHasMoved) {
|
||||
|
Loading…
Reference in New Issue
Block a user