The Desktop class now gets its own message processing loop: moved application

creation/deletion (and management) over to that class.
ServerApp now gets a desktop pointer, and no longer uses gDesktop.
Converted private MessageLooper::_MessagePort() to a public method MessagePort()
so that the looper can be addressed from elsewhere without using PostMessage().
Added a real basic message loop to MessageLooper::_MessageLoop().
BApplication now only asks the app_server to get its desktop object which should
now be used for everything that's not in the realm of the application.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13824 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-07-25 21:08:34 +00:00
parent 5845b8c325
commit 770c05d6cc
11 changed files with 320 additions and 260 deletions
+16 -3
View File
@@ -1078,6 +1078,21 @@ BApplication::connect_to_app_server()
return clientPort;
// We can't use AppServerLink because be_app == NULL
fServerLink->SetTo(serverPort, clientPort);
fServerLink->StartMessage(AS_GET_DESKTOP);
fServerLink->Attach<port_id>(clientPort);
fServerLink->Attach<int32>(getuid());
int32 code;
if (fServerLink->FlushWithReply(code) != B_OK || code != B_OK) {
fServerLink->SetSenderPort(-1);
return B_ERROR;
}
// we talk to the desktop to create our application
fServerLink->Read<port_id>(&serverPort);
fServerLink->SetSenderPort(serverPort);
// AS_CREATE_APP:
//
@@ -1087,7 +1102,6 @@ BApplication::connect_to_app_server()
// 3) team_id - team identification field
// 4) int32 - handler ID token of the app
// 5) char * - signature of the regular app
fServerLink->SetTo(serverPort, clientPort);
fServerLink->StartMessage(AS_CREATE_APP);
fServerLink->Attach<port_id>(clientPort);
@@ -1096,9 +1110,8 @@ BApplication::connect_to_app_server()
fServerLink->Attach<int32>(_get_object_token_(this));
fServerLink->AttachString(fAppName);
int32 code;
if (fServerLink->FlushWithReply(code) == B_OK
&& code == SERVER_TRUE) {
&& code == B_OK) {
// We don't need to contact the main app_server anymore
// directly; we now talk to our server alter ego only.
fServerLink->Read<port_id>(&serverPort);