Moved initialization of the system color map from AppServer to Desktop

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22661 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2007-10-22 14:07:26 +00:00
parent 37b83b1a2d
commit 09a4122e4c
2 changed files with 7 additions and 6 deletions

View File

@ -17,7 +17,6 @@
#include "InputManager.h" #include "InputManager.h"
#include "ScreenManager.h" #include "ScreenManager.h"
#include "ServerProtocol.h" #include "ServerProtocol.h"
#include "SystemPalette.h"
#include <PortLink.h> #include <PortLink.h>
@ -71,10 +70,6 @@ AppServer::AppServer()
gScreenManager = new ScreenManager(); gScreenManager = new ScreenManager();
gScreenManager->Run(); gScreenManager->Run();
// the system palette needs to be initialized before the desktop,
// since it is used there already
InitializeColorMap();
// Create the bitmap allocator. Object declared in BitmapManager.cpp // Create the bitmap allocator. Object declared in BitmapManager.cpp
gBitmapManager = new BitmapManager(); gBitmapManager = new BitmapManager();

View File

@ -23,6 +23,7 @@
#include "ServerCursor.h" #include "ServerCursor.h"
#include "ServerScreen.h" #include "ServerScreen.h"
#include "ServerWindow.h" #include "ServerWindow.h"
#include "SystemPalette.h"
#include "WindowPrivate.h" #include "WindowPrivate.h"
#include "WindowLayer.h" #include "WindowLayer.h"
#include "Workspace.h" #include "Workspace.h"
@ -358,10 +359,15 @@ Desktop::Init()
if (fMessagePort < B_OK) if (fMessagePort < B_OK)
return fMessagePort; return fMessagePort;
// the system palette needs to be initialized before the
// desktop settings, since it is used there already
InitializeColorMap();
const size_t areaSize = B_PAGE_SIZE;
char name[B_OS_NAME_LENGTH]; char name[B_OS_NAME_LENGTH];
snprintf(name, sizeof(name), "d:%d:shared read only", /*id*/0); snprintf(name, sizeof(name), "d:%d:shared read only", /*id*/0);
fSharedReadOnlyArea = create_area(name, (void **)&fServerReadOnlyMemory, fSharedReadOnlyArea = create_area(name, (void **)&fServerReadOnlyMemory,
B_ANY_ADDRESS, B_PAGE_SIZE, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA); B_ANY_ADDRESS, areaSize, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
if (fSharedReadOnlyArea < B_OK) if (fSharedReadOnlyArea < B_OK)
return fSharedReadOnlyArea; return fSharedReadOnlyArea;