From 52e43a20be446f7dffbb41eedd87d6b9a8ce00cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 3 Sep 2015 19:36:44 +0200 Subject: [PATCH] Terminal: replaced positioning with BWindow::MoveOnScreen(). * The previous mechanism was pretty crude, and didn't work that well. --- src/apps/terminal/TermWindow.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp index 8519082097..4b1ce3ba53 100644 --- a/src/apps/terminal/TermWindow.cpp +++ b/src/apps/terminal/TermWindow.cpp @@ -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 {