Messaging fixes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8542 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -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<team_id>(&clientTeamID);
|
||||
msg.Read<int32>(&htoken);
|
||||
msg.ReadString(&app_signature);
|
||||
msg.Read<int32>(&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<int32>(newapp->fMessagePort);
|
||||
replylink.Flush();
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "LayerData.h"
|
||||
#include "Utils.h"
|
||||
|
||||
//#define DEBUG_SERVERAPP
|
||||
#define DEBUG_SERVERAPP
|
||||
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
# include <stdio.h>
|
||||
@@ -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<BRect>(&frame);
|
||||
msg.Read<int32>((int32*)&look);
|
||||
msg.Read<int32>((int32*)&feel);
|
||||
@@ -527,7 +520,7 @@ void ServerApp::_DispatchMessage(int32 code, BPortLink& msg)
|
||||
msg.ReadString(&title);
|
||||
|
||||
//TODO: deprecate - just use sendPort
|
||||
msg.Read<port_id>(&replyport);
|
||||
// msg.Read<port_id>(&replyport);
|
||||
|
||||
STRACE(("ServerApp %s: Got 'New Window' message, trying to do smething...\n",fSignature.String()));
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user