* Workspace offsets weren't correct (only for the first workspace).

* No longer draws hidden windows.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15450 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-12-09 16:19:18 +00:00
parent 9d34a4b6d7
commit 52d2c710bf
2 changed files with 13 additions and 4 deletions

View File

@ -64,15 +64,14 @@ WorkspacesLayer::_WorkspaceAt(int32 i)
BRect rect(column * width, row * height, (column + 1) * width, (row + 1) * height);
rect.OffsetBy(Frame().LeftTop());
// make sure there is no gap anywhere
if (column == columns - 1)
rect.right = Frame().right;
if (row == rows - 1)
rect.bottom = Frame().bottom;
BPoint pt(0,0);
ConvertToScreen(&pt);
rect.OffsetBy(pt);
return rect;
}
@ -103,7 +102,7 @@ WorkspacesLayer::_DrawWindow(DrawingEngine* drawingEngine, const BRect& workspac
const BRect& screenFrame, WindowLayer* window, BPoint windowPosition,
BRegion& backgroundRegion, bool active)
{
if (window->Feel() == kDesktopWindowFeel)
if (window->Feel() == kDesktopWindowFeel || window->IsHidden())
return;
BPoint offset = window->Frame().LeftTop() - windowPosition;
@ -305,3 +304,11 @@ WorkspacesLayer::MouseDown(BMessage* message, BPoint where, int32* _viewToken)
}
void
WorkspacesLayer::WindowChanged(WindowLayer* window)
{
// TODO: be smarter about this!
BRegion region(Frame());
Window()->MarkContentDirty(region);
}

View File

@ -26,6 +26,8 @@ class WorkspacesLayer : public ViewLayer {
bool deep = false);
virtual void MouseDown(BMessage* message, BPoint where, int32* _viewToken);
void WindowChanged(WindowLayer* window);
private:
void _GetGrid(int32& columns, int32& rows);
BRect _WorkspaceAt(int32 i);