diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index 8877fff855..88f8d2a16e 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -2123,6 +2123,33 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) break; } + case AS_SET_DESKTOP_COLOR: + { + STRACE(("ServerApp %s: set desktop color\n", Signature())); + + rgb_color color; + uint32 index; + bool makeDefault; + + link.Read(&color); + link.Read(&index); + if (link.Read(&makeDefault) != B_OK) + break; + + fDesktop->Lock(); + + // we're nice to our children (and also take the default case + // into account which asks for the current workspace) + if (index >= (uint32)kMaxWorkspaces) + index = fDesktop->CurrentWorkspace(); + + Workspace workspace(*fDesktop, index); + workspace.SetColor(color, makeDefault); + + fDesktop->Unlock(); + break; + } + case AS_GET_ACCELERANT_INFO: { STRACE(("ServerApp %s: get accelerant info\n", Signature())); diff --git a/src/servers/app/Workspace.cpp b/src/servers/app/Workspace.cpp index 9e0094941a..c5ebf6e0b8 100644 --- a/src/servers/app/Workspace.cpp +++ b/src/servers/app/Workspace.cpp @@ -90,6 +90,15 @@ Workspace::Color() const } +void +Workspace::SetColor(const RGBColor& color, bool makeDefault) +{ + // TODO: support makeDefault + // TODO: redraw desktop! + fWorkspace.SetColor(color); +} + + status_t Workspace::GetNextWindow(WindowLayer*& _window, BPoint& _leftTop) { diff --git a/src/servers/app/Workspace.h b/src/servers/app/Workspace.h index 4db551ed68..5adba0e391 100644 --- a/src/servers/app/Workspace.h +++ b/src/servers/app/Workspace.h @@ -23,6 +23,7 @@ class Workspace { ~Workspace(); const RGBColor& Color() const; + void SetColor(const RGBColor& color, bool makeDefault); bool IsCurrent() const { return fCurrentWorkspace; }