improved version

though the first workspace color isn't kept between boots


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17116 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2006-04-12 20:55:36 +00:00
parent 34ff238b88
commit 82081c70ea
3 changed files with 11 additions and 15 deletions
+8 -12
View File
@@ -661,20 +661,16 @@ Desktop::RedrawBackground()
\brief Store the workspace configuration \brief Store the workspace configuration
*/ */
void void
Desktop::StoreWorkspaceConfiguration(Workspace::Private *workspace) Desktop::StoreWorkspaceConfiguration(int32 index)
{ {
// store settings // store settings
for (int32 index = 0; index < 32; index++) { const BMessage *oldSettings = fSettings->WorkspacesMessage(index);
if (&fWorkspaces[index] == workspace) { BMessage settings;
const BMessage *oldSettings = fSettings->WorkspacesMessage(index); if (oldSettings)
BMessage settings; settings = *oldSettings;
if (oldSettings) fWorkspaces[index].StoreConfiguration(settings);
settings = *oldSettings; fSettings->SetWorkspacesMessage(index, settings);
workspace->StoreConfiguration(settings); fSettings->Save(kWorkspacesSettings);
fSettings->Save(kWorkspacesSettings);
break;
}
}
} }
+2 -2
View File
@@ -163,7 +163,7 @@ class Desktop : public MessageLooper, public ScreenOwner {
{ return fBackgroundRegion; } { return fBackgroundRegion; }
void RedrawBackground(); void RedrawBackground();
void StoreWorkspaceConfiguration(Workspace::Private *workspace); void StoreWorkspaceConfiguration(int32 index);
void MinimizeApplication(team_id team); void MinimizeApplication(team_id team);
void BringApplicationToFront(team_id team); void BringApplicationToFront(team_id team);
@@ -224,7 +224,7 @@ class Desktop : public MessageLooper, public ScreenOwner {
sem_id fShutdownSemaphore; sem_id fShutdownSemaphore;
int32 fShutdownCount; int32 fShutdownCount;
::Workspace::Private fWorkspaces[32]; ::Workspace::Private fWorkspaces[kMaxWorkspaces];
int32 fCurrentWorkspace; int32 fCurrentWorkspace;
WindowList fAllWindows; WindowList fAllWindows;
+1 -1
View File
@@ -108,7 +108,7 @@ Workspace::SetColor(const RGBColor& color, bool makeDefault)
fWorkspace.SetColor(color); fWorkspace.SetColor(color);
fDesktop.RedrawBackground(); fDesktop.RedrawBackground();
if (makeDefault) if (makeDefault)
fDesktop.StoreWorkspaceConfiguration(&fWorkspace); fDesktop.StoreWorkspaceConfiguration(fWorkspace.Index());
} }