When removing a window from the stack keep the mouse at the same tab position.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42576 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -424,6 +424,10 @@ SATWindow::StackWindow(SATWindow* child)
|
||||
void
|
||||
SATWindow::RemovedFromArea(WindowArea* area)
|
||||
{
|
||||
SATDecorator* decorator = GetDecorator();
|
||||
if (decorator != NULL)
|
||||
fOldTabLocatiom = decorator->TabRect(fWindow->PositionInStack()).left;
|
||||
|
||||
fWindow->DetachFromWindowStack(true);
|
||||
for (int i = 0; i < fSATSnappingBehaviourList.CountItems(); i++)
|
||||
fSATSnappingBehaviourList.ItemAt(i)->RemovedFromArea(area);
|
||||
@@ -776,11 +780,8 @@ SATWindow::_RestoreOriginalSize(bool stayBelowMouse)
|
||||
&& mousePosition.x <= frame.right + decorator->BorderWidth() +1
|
||||
&& mousePosition.x >= frame.left + decorator->BorderWidth()) {
|
||||
// verify mouse stays on the tab
|
||||
float deltaX = 0;
|
||||
if (tabRect.right < mousePosition.x)
|
||||
deltaX = mousePosition.x - tabRect.right + 20;
|
||||
else if (tabRect.left > mousePosition.x)
|
||||
deltaX = mousePosition.x - tabRect.left - 20;
|
||||
float oldOffset = mousePosition.x - fOldTabLocatiom;
|
||||
float deltaX = mousePosition.x - (tabRect.left + oldOffset);
|
||||
fDesktop->MoveWindowBy(fWindow, deltaX, 0);
|
||||
} else {
|
||||
// verify mouse stays on the border
|
||||
|
||||
@@ -174,6 +174,8 @@ private:
|
||||
float fOriginalHeight;
|
||||
|
||||
uint64 fId;
|
||||
|
||||
float fOldTabLocatiom;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user