Someone (like the screen_blanker) could call

BDirectWindow::SetFullScreen() before the window is shown.
The app_server didn't like this, since in that case, Window::Screen() is
NULL. I added a check to ServerWindow::_ResizeToFullScreen() to handle
that case. +alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32774 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2009-08-28 09:22:40 +00:00
parent 35d1ffa9c4
commit e5c25980bd
+8 -1
View File
@@ -3561,7 +3561,13 @@ ServerWindow::_MessageNeedsAllWindowsLocked(uint32 code) const
void
ServerWindow::_ResizeToFullScreen()
{
BRect screenFrame = fWindow->Screen()->Frame();
const Screen *screen = fWindow->Screen();
if (screen == NULL) {
return;
// the window isn't yet attached to a screen
}
BRect screenFrame = screen->Frame();
fDesktop->MoveWindowBy(fWindow,
screenFrame.left - fWindow->Frame().left,
@@ -3605,6 +3611,7 @@ ServerWindow::_DirectWindowSetFullScreen(bool enable)
fDesktop->HWInterface()->SetCursorVisible(false);
fDirectWindowInfo->EnableFullScreen(fWindow->Frame(), fWindow->Feel());
_ResizeToFullScreen();
} else {
const BRect& originalFrame = fDirectWindowInfo->OriginalFrame();