From 7938b1158eca0a2dfd41ee8b3c8c4023406cdaa3 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Sat, 18 Feb 2006 09:38:42 +0000 Subject: [PATCH] Decorator() can be NULL in case the look is B_NO_BORDER_WINDOW_LOOK. Fixes bug 204 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16458 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/WorkspacesLayer.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/servers/app/WorkspacesLayer.cpp b/src/servers/app/WorkspacesLayer.cpp index 9a4fd12899..d135181921 100644 --- a/src/servers/app/WorkspacesLayer.cpp +++ b/src/servers/app/WorkspacesLayer.cpp @@ -108,12 +108,18 @@ WorkspacesLayer::_DrawWindow(DrawingEngine* drawingEngine, const BRect& workspac BPoint offset = window->Frame().LeftTop() - windowPosition; BRect frame = _WindowFrame(workspaceFrame, screenFrame, window->Frame(), windowPosition); - BRect tabFrame = window->Decorator()->TabRect(); + Decorator *decorator = window->Decorator(); + BRect tabFrame(0, 0, 0, 0); + if (decorator != NULL) + tabFrame = decorator->TabRect(); + tabFrame = _WindowFrame(workspaceFrame, screenFrame, tabFrame, tabFrame.LeftTop() - offset); // ToDo: let decorator do this! - RGBColor yellow = window->Decorator()->Colors().window_tab; + RGBColor yellow; + if (decorator != NULL) + yellow = decorator->Colors().window_tab; RGBColor gray(180, 180, 180); RGBColor white(255, 255, 255); @@ -134,7 +140,8 @@ WorkspacesLayer::_DrawWindow(DrawingEngine* drawingEngine, const BRect& workspac backgroundRegion.Exclude(tabFrame); backgroundRegion.Exclude(frame); - drawingEngine->StrokeLine(tabFrame.LeftTop(), tabFrame.RightBottom(), yellow); + if (decorator != NULL) + drawingEngine->StrokeLine(tabFrame.LeftTop(), tabFrame.RightBottom(), yellow); drawingEngine->StrokeRect(frame, gray);