Terminal: make sure window fits in screen.

Fixes #8414.
This commit is contained in:
Adrien Destugues
2014-11-10 12:52:01 +01:00
parent 482f0eeb01
commit a95a728ca0
+8 -3
View File
@@ -223,9 +223,14 @@ TermWindow::TermWindow(const BString& title, Arguments* args)
BRect frame;
uint32 workspaces;
if (_LoadWindowPosition(&frame, &workspaces) == B_OK) {
// apply
MoveTo(frame.LeftTop());
ResizeTo(frame.Width(), frame.Height());
// 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());
ResizeTo(frame.Width(), frame.Height());
} else
CenterOnScreen();
SetWorkspaces(workspaces);
} else {
// use computed defaults