From e5c25980bd5fafa2e73b84d53608d328b86a6ad5 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Fri, 28 Aug 2009 09:22:40 +0000 Subject: [PATCH] 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 --- src/servers/app/ServerWindow.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index a249930fd3..641791d13f 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -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();