diff --git a/src/servers/app/server/AppServer.cpp b/src/servers/app/server/AppServer.cpp index 41da5e2564..ddddc6e87e 100644 --- a/src/servers/app/server/AppServer.cpp +++ b/src/servers/app/server/AppServer.cpp @@ -462,12 +462,10 @@ void AppServer::DispatchMessage(int32 code, BPortLink &msg) // 2) team_id - app's team ID // 3) int32 - handler token of the regular app // 4) char * - signature of the regular app - // 5) port_id - port to reply to // Find the necessary data team_id clientTeamID=-1; port_id clientLooperPort=-1; - port_id reply_port=-1; // TODO: deprecated port_id app_port=-1; int32 htoken=B_NULL_TOKEN; char *app_signature=NULL; @@ -477,7 +475,6 @@ void AppServer::DispatchMessage(int32 code, BPortLink &msg) msg.Read(&clientTeamID); msg.Read(&htoken); msg.ReadString(&app_signature); - msg.Read(&reply_port); // Create the ServerApp subthread for this app acquire_sem(fAppListLock); @@ -498,7 +495,7 @@ void AppServer::DispatchMessage(int32 code, BPortLink &msg) release_sem(fAppListLock); - BPortLink replylink(reply_port); + BPortLink replylink(app_port); replylink.StartMessage(AS_SET_SERVER_PORT); replylink.Attach(newapp->fMessagePort); replylink.Flush(); diff --git a/src/servers/app/server/ServerApp.cpp b/src/servers/app/server/ServerApp.cpp index 5fa921abee..2523db7d63 100644 --- a/src/servers/app/server/ServerApp.cpp +++ b/src/servers/app/server/ServerApp.cpp @@ -52,7 +52,7 @@ #include "LayerData.h" #include "Utils.h" -//#define DEBUG_SERVERAPP +#define DEBUG_SERVERAPP #ifdef DEBUG_SERVERAPP # include @@ -330,7 +330,7 @@ void ServerApp::SetAppCursor(void) int32 ServerApp::MonitorApp(void *data) { // Message-dispatching loop for the ServerApp - + ServerApp *app = (ServerApp *)data; BPortLink msgqueue(-1, app->fMessagePort); bool quitting = false; @@ -362,13 +362,6 @@ int32 ServerApp::MonitorApp(void *data) { BMessage pleaseQuit(B_QUIT_REQUESTED); app->SendMessageToClient(&pleaseQuit); -// TODO: I do not understand why we nee this? delete. -// When BApplications receives B_QUIT_REQUESTED, it asks its BWindow(s) if it can -// safely quit. If all respond with 'true' then, each one that 'agrees' will send -// a AS_DELETE_WINDOW message to the server couterpart thread (ServerWindow). Curently, -// it always quits on this message. -// DW, I left this text here for you to see it. After you read, please remove it. Thanks. -// app->WindowBroadcast(AS_QUIT_APP); } break; } @@ -515,7 +508,7 @@ void ServerApp::_DispatchMessage(int32 code, BPortLink& msg) port_id looperPort = -1; char *title = NULL; port_id replyport = -1; - + msg.Read(&frame); msg.Read((int32*)&look); msg.Read((int32*)&feel); @@ -527,7 +520,7 @@ void ServerApp::_DispatchMessage(int32 code, BPortLink& msg) msg.ReadString(&title); //TODO: deprecate - just use sendPort - msg.Read(&replyport); +// msg.Read(&replyport); STRACE(("ServerApp %s: Got 'New Window' message, trying to do smething...\n",fSignature.String())); diff --git a/src/servers/app/server/ServerApp.h b/src/servers/app/server/ServerApp.h index eaa2ad386f..6751edbbff 100644 --- a/src/servers/app/server/ServerApp.h +++ b/src/servers/app/server/ServerApp.h @@ -86,6 +86,8 @@ protected: port_id fClientAppPort, fMessagePort, + // TODO: find out why there is both the app port and the looper port. Do + // we really need both? fClientLooperPort; BString fSignature;