Terminal: replaced positioning with BWindow::MoveOnScreen().

* The previous mechanism was pretty crude, and didn't work that well.
This commit is contained in:
Axel Dörfler 2015-09-03 19:36:44 +02:00
parent ebf4cbe6e7
commit 52e43a20be

View File

@ -225,11 +225,13 @@ TermWindow::TermWindow(const BString& title, Arguments* args)
if (_LoadWindowPosition(&frame, &workspaces) == B_OK) {
// make sure the window is still on screen
// (for example if there was a resolution change)
if (frame.Intersects(BScreen(this).Frame())) {
MoveTo(frame.LeftTop());
BRect screenFrame = BScreen(this).Frame();
if (frame.Width() <= screenFrame.Width()
&& frame.Height() <= screenFrame.Height())
ResizeTo(frame.Width(), frame.Height());
} else
CenterOnScreen();
MoveTo(frame.LeftTop());
MoveOnScreen();
SetWorkspaces(workspaces);
} else {