diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index 1806c8a19c..f4a2b05cc0 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -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 Desktop::UpdateWorkspaces() { diff --git a/src/servers/app/Desktop.h b/src/servers/app/Desktop.h index ab410c1a84..a7cd51fc1e 100644 --- a/src/servers/app/Desktop.h +++ b/src/servers/app/Desktop.h @@ -158,6 +158,8 @@ class Desktop : public MessageLooper, public ScreenOwner { BRegion& BackgroundRegion() { return fBackgroundRegion; } + void RedrawBackground(); + void MinimizeApplication(team_id team); void BringApplicationToFront(team_id team); diff --git a/src/servers/app/Workspace.cpp b/src/servers/app/Workspace.cpp index 4e5bd2a383..c58485a54a 100644 --- a/src/servers/app/Workspace.cpp +++ b/src/servers/app/Workspace.cpp @@ -98,9 +98,12 @@ Workspace::Color() const void Workspace::SetColor(const RGBColor& color, bool makeDefault) { + if (color == Color()) + return; + // TODO: support makeDefault - // TODO: redraw desktop! fWorkspace.SetColor(color); + fDesktop.RedrawBackground(); }