Resolved a TODO: WorkspacesLayer must take the whole workspaces frame into account, not

just the one of the first screen. This also solves a locking bug, as the HWInterface
is already read-locked when WorkspacesLayer::Draw() is called.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20054 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2007-02-02 18:14:25 +00:00
parent 234554ce4b
commit cb134e2550
4 changed files with 30 additions and 13 deletions
+3 -1
View File
@@ -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;
+23 -1
View File
@@ -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
*/
+2 -1
View File
@@ -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
+2 -10
View File
@@ -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();
}