Terminal: replaced positioning with BWindow::MoveOnScreen().
* The previous mechanism was pretty crude, and didn't work that well.
This commit is contained in:
@@ -225,11 +225,13 @@ TermWindow::TermWindow(const BString& title, Arguments* args)
|
|||||||
if (_LoadWindowPosition(&frame, &workspaces) == B_OK) {
|
if (_LoadWindowPosition(&frame, &workspaces) == B_OK) {
|
||||||
// make sure the window is still on screen
|
// make sure the window is still on screen
|
||||||
// (for example if there was a resolution change)
|
// (for example if there was a resolution change)
|
||||||
if (frame.Intersects(BScreen(this).Frame())) {
|
BRect screenFrame = BScreen(this).Frame();
|
||||||
MoveTo(frame.LeftTop());
|
if (frame.Width() <= screenFrame.Width()
|
||||||
|
&& frame.Height() <= screenFrame.Height())
|
||||||
ResizeTo(frame.Width(), frame.Height());
|
ResizeTo(frame.Width(), frame.Height());
|
||||||
} else
|
|
||||||
CenterOnScreen();
|
MoveTo(frame.LeftTop());
|
||||||
|
MoveOnScreen();
|
||||||
|
|
||||||
SetWorkspaces(workspaces);
|
SetWorkspaces(workspaces);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user