Implemented redrawing the desktop after color changes. Right now, it only works

correctly when Tracker is not running; obviously, the background is cleared in
Tracker before it had the chance of changing the view color.
Maybe the app_server needs to detect the background view of the desktop and
change the view color manually :-/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16376 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-02-13 13:12:10 +00:00
parent ad896dfe66
commit 3dcbe9fc88
3 changed files with 31 additions and 1 deletions

View File

@ -590,6 +590,31 @@ Desktop::SetCursor(ServerCursor* newCursor)
} }
/*!
\brief Redraws the background (ie. the desktop window, if any).
*/
void
Desktop::RedrawBackground()
{
LockAllWindows();
BRegion redraw;
WindowLayer* window = _CurrentWindows().FirstWindow();
if (window->Feel() == kDesktopWindowFeel) {
// TODO: this doesn't work correctly, yet
redraw = window->VisibleContentRegion();
window->ProcessDirtyRegion(redraw);
} else {
redraw = BackgroundRegion();
fBackgroundRegion.MakeEmpty();
_SetBackground(redraw);
}
UnlockAllWindows();
}
void void
Desktop::UpdateWorkspaces() Desktop::UpdateWorkspaces()
{ {

View File

@ -158,6 +158,8 @@ class Desktop : public MessageLooper, public ScreenOwner {
BRegion& BackgroundRegion() BRegion& BackgroundRegion()
{ return fBackgroundRegion; } { return fBackgroundRegion; }
void RedrawBackground();
void MinimizeApplication(team_id team); void MinimizeApplication(team_id team);
void BringApplicationToFront(team_id team); void BringApplicationToFront(team_id team);

View File

@ -98,9 +98,12 @@ Workspace::Color() const
void void
Workspace::SetColor(const RGBColor& color, bool makeDefault) Workspace::SetColor(const RGBColor& color, bool makeDefault)
{ {
if (color == Color())
return;
// TODO: support makeDefault // TODO: support makeDefault
// TODO: redraw desktop!
fWorkspace.SetColor(color); fWorkspace.SetColor(color);
fDesktop.RedrawBackground();
} }