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
|
void
|
||||||
SATWindow::RemovedFromArea(WindowArea* area)
|
SATWindow::RemovedFromArea(WindowArea* area)
|
||||||
{
|
{
|
||||||
|
SATDecorator* decorator = GetDecorator();
|
||||||
|
if (decorator != NULL)
|
||||||
|
fOldTabLocatiom = decorator->TabRect(fWindow->PositionInStack()).left;
|
||||||
|
|
||||||
fWindow->DetachFromWindowStack(true);
|
fWindow->DetachFromWindowStack(true);
|
||||||
for (int i = 0; i < fSATSnappingBehaviourList.CountItems(); i++)
|
for (int i = 0; i < fSATSnappingBehaviourList.CountItems(); i++)
|
||||||
fSATSnappingBehaviourList.ItemAt(i)->RemovedFromArea(area);
|
fSATSnappingBehaviourList.ItemAt(i)->RemovedFromArea(area);
|
||||||
@@ -776,11 +780,8 @@ SATWindow::_RestoreOriginalSize(bool stayBelowMouse)
|
|||||||
&& mousePosition.x <= frame.right + decorator->BorderWidth() +1
|
&& mousePosition.x <= frame.right + decorator->BorderWidth() +1
|
||||||
&& mousePosition.x >= frame.left + decorator->BorderWidth()) {
|
&& mousePosition.x >= frame.left + decorator->BorderWidth()) {
|
||||||
// verify mouse stays on the tab
|
// verify mouse stays on the tab
|
||||||
float deltaX = 0;
|
float oldOffset = mousePosition.x - fOldTabLocatiom;
|
||||||
if (tabRect.right < mousePosition.x)
|
float deltaX = mousePosition.x - (tabRect.left + oldOffset);
|
||||||
deltaX = mousePosition.x - tabRect.right + 20;
|
|
||||||
else if (tabRect.left > mousePosition.x)
|
|
||||||
deltaX = mousePosition.x - tabRect.left - 20;
|
|
||||||
fDesktop->MoveWindowBy(fWindow, deltaX, 0);
|
fDesktop->MoveWindowBy(fWindow, deltaX, 0);
|
||||||
} else {
|
} else {
|
||||||
// verify mouse stays on the border
|
// verify mouse stays on the border
|
||||||
|
|||||||
@@ -174,6 +174,8 @@ private:
|
|||||||
float fOriginalHeight;
|
float fOriginalHeight;
|
||||||
|
|
||||||
uint64 fId;
|
uint64 fId;
|
||||||
|
|
||||||
|
float fOldTabLocatiom;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user