* If you click on a window in the Workspaces view, it won't move until you
move the mouse a bit more. This should help with "fast" workspace switches when you click on a workspace and accidently move the mouse a bit. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27977 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -467,6 +467,7 @@ WorkspacesView::MouseDown(BMessage* message, BPoint where)
|
||||
|
||||
fLeftTopOffset = where - windowFrame.LeftTop();
|
||||
fSelectedWorkspace = index;
|
||||
fClickPoint = where;
|
||||
|
||||
if (index >= 0)
|
||||
_Invalidate();
|
||||
@@ -550,10 +551,15 @@ WorkspacesView::MouseMoved(BMessage* message, BPoint where)
|
||||
leftTop = fSelectedWindow->Anchor(fSelectedWorkspace).position;
|
||||
}
|
||||
|
||||
Window()->Desktop()->MoveWindowBy(fSelectedWindow, left - leftTop.x, top - leftTop.y,
|
||||
fSelectedWorkspace);
|
||||
float diff = (fClickPoint.x - where.x) * (fClickPoint.x - where.x)
|
||||
+ (fClickPoint.y - where.y) * (fClickPoint.y - where.y);
|
||||
if (!fHasMoved && diff > 4)
|
||||
fHasMoved = true;
|
||||
|
||||
fHasMoved = true;
|
||||
if (fHasMoved) {
|
||||
Window()->Desktop()->MoveWindowBy(fSelectedWindow, left - leftTop.x,
|
||||
top - leftTop.y, fSelectedWorkspace);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ private:
|
||||
::Window* fSelectedWindow;
|
||||
int32 fSelectedWorkspace;
|
||||
bool fHasMoved;
|
||||
BPoint fClickPoint;
|
||||
BPoint fLeftTopOffset;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user