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:
parent
ad896dfe66
commit
3dcbe9fc88
@ -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()
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user