diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index 70b4710922..a492320980 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -961,6 +961,8 @@ Desktop::ScreenChanged(Screen* screen, bool makeDefault) window->ServerWindow()->SendMessageToClient(&update); } + fVirtualScreen.UpdateFrame(); + if (makeDefault) { // store settings BMessage settings; diff --git a/src/servers/app/VirtualScreen.cpp b/src/servers/app/VirtualScreen.cpp index e8c198bcd9..ba667a0e1c 100644 --- a/src/servers/app/VirtualScreen.cpp +++ b/src/servers/app/VirtualScreen.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006, Haiku. + * Copyright 2005-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -155,6 +155,28 @@ VirtualScreen::RemoveScreen(Screen* screen) } +void +VirtualScreen::UpdateFrame() +{ + int32 virtualWidth = 0, virtualHeight = 0; + + for (int32 i = 0; i < fScreenList.CountItems(); i++) { + Screen* screen = fScreenList.ItemAt(i)->screen; + + uint16 width, height; + uint32 colorSpace; + float frequency; + screen->GetMode(width, height, colorSpace, frequency); + + // TODO: compute virtual size depending on the actual screen position! + virtualWidth += width; + virtualHeight += height; + } + + fFrame.Set(0, 0, virtualWidth - 1, virtualHeight - 1); +} + + /*! Returns the smallest frame that spans over all screens */ diff --git a/src/servers/app/VirtualScreen.h b/src/servers/app/VirtualScreen.h index b28f4f8166..1ff4b98ad0 100644 --- a/src/servers/app/VirtualScreen.h +++ b/src/servers/app/VirtualScreen.h @@ -1,5 +1,5 @@ /* - * Copyright 2005, Haiku. + * Copyright 2005-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -37,6 +37,7 @@ class VirtualScreen { status_t AddScreen(Screen* screen); status_t RemoveScreen(Screen* screen); + void UpdateFrame(); BRect Frame() const; // TODO: we need to play with a real multi-screen configuration to diff --git a/src/servers/app/WorkspacesLayer.cpp b/src/servers/app/WorkspacesLayer.cpp index e39f97f48b..30e1d2a28f 100644 --- a/src/servers/app/WorkspacesLayer.cpp +++ b/src/servers/app/WorkspacesLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006, Haiku Inc. + * Copyright 2005-2007, Haiku Inc. * Distributed under the terms of the MIT License. * * Authors: @@ -60,15 +60,7 @@ WorkspacesLayer::_GetGrid(int32& columns, int32& rows) BRect WorkspacesLayer::_ScreenFrame(int32 i) { - // TODO: we don't need the current screen frame, but the one - // from the workspace! - uint16 width, height; - uint32 colorSpace; - float frequency; - Window()->Desktop()->ScreenAt(0)->GetMode(width, height, - colorSpace, frequency); - - return BRect(0, 0, width - 1, height - 1); + return Window()->Desktop()->VirtualScreen().Frame(); }