Tweaks to handle the changes in messaging protocol formats
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5014 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -205,7 +205,6 @@ int32 AppServer::PollerThread(void *data)
|
|||||||
{
|
{
|
||||||
// This thread handles nothing but input messages for mouse and keyboard
|
// This thread handles nothing but input messages for mouse and keyboard
|
||||||
AppServer *appserver=(AppServer*)data;
|
AppServer *appserver=(AppServer*)data;
|
||||||
int8 *index;
|
|
||||||
PortQueue mousequeue(appserver->_mouseport);
|
PortQueue mousequeue(appserver->_mouseport);
|
||||||
PortMessage *msg;
|
PortMessage *msg;
|
||||||
|
|
||||||
@@ -244,21 +243,13 @@ int32 AppServer::PollerThread(void *data)
|
|||||||
// 3) float - y coordinate of mouse click
|
// 3) float - y coordinate of mouse click
|
||||||
// 4) int32 - buttons down
|
// 4) int32 - buttons down
|
||||||
|
|
||||||
index=(int8*)msg->Buffer();
|
int64 dummy;
|
||||||
if(!index)
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Skip past the message code
|
|
||||||
index += sizeof(int32);
|
|
||||||
|
|
||||||
// Time sent is not necessary for cursor processing.
|
|
||||||
index += sizeof(int64);
|
|
||||||
|
|
||||||
float tempx=0,tempy=0;
|
float tempx=0,tempy=0;
|
||||||
tempx=*((float*)index);
|
|
||||||
index+=sizeof(float);
|
msg->Read<int64>(&dummy);
|
||||||
tempy=*((float*)index);
|
msg->Read<float>(&tempx);
|
||||||
index+=sizeof(float);
|
msg->Read<float>(&tempy);
|
||||||
|
msg->Rewind();
|
||||||
|
|
||||||
if(appserver->_driver)
|
if(appserver->_driver)
|
||||||
{
|
{
|
||||||
@@ -343,12 +334,15 @@ void AppServer::MainLoop(void)
|
|||||||
{
|
{
|
||||||
if(pmsg.ReadFromPort(_messageport)==B_OK)
|
if(pmsg.ReadFromPort(_messageport)==B_OK)
|
||||||
{
|
{
|
||||||
|
if(pmsg.Protocol()==B_QUIT_REQUESTED)
|
||||||
|
pmsg.SetCode(B_QUIT_REQUESTED);
|
||||||
|
|
||||||
switch(pmsg.Code())
|
switch(pmsg.Code())
|
||||||
{
|
{
|
||||||
|
case B_QUIT_REQUESTED:
|
||||||
case AS_CREATE_APP:
|
case AS_CREATE_APP:
|
||||||
case AS_DELETE_APP:
|
case AS_DELETE_APP:
|
||||||
case AS_GET_SCREEN_MODE:
|
case AS_GET_SCREEN_MODE:
|
||||||
case B_QUIT_REQUESTED:
|
|
||||||
case AS_UPDATED_CLIENT_FONTLIST:
|
case AS_UPDATED_CLIENT_FONTLIST:
|
||||||
case AS_QUERY_FONTS_CHANGED:
|
case AS_QUERY_FONTS_CHANGED:
|
||||||
case AS_SET_UI_COLORS:
|
case AS_SET_UI_COLORS:
|
||||||
@@ -368,7 +362,7 @@ void AppServer::MainLoop(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pmsg.Code()==AS_DELETE_APP || (pmsg.Code()==B_QUIT_REQUESTED && DISPLAYDRIVER!=HWDRIVER))
|
if(pmsg.Code()==AS_DELETE_APP || (pmsg.Protocol()==B_QUIT_REQUESTED && DISPLAYDRIVER!=HWDRIVER))
|
||||||
{
|
{
|
||||||
if(_quitting_server==true && _applist->CountItems()==0)
|
if(_quitting_server==true && _applist->CountItems()==0)
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -497,7 +497,9 @@ bool VDWindow::QuitRequested(void)
|
|||||||
port_id serverport=find_port(SERVER_PORT_NAME);
|
port_id serverport=find_port(SERVER_PORT_NAME);
|
||||||
|
|
||||||
if(serverport!=B_NAME_NOT_FOUND)
|
if(serverport!=B_NAME_NOT_FOUND)
|
||||||
|
{
|
||||||
write_port(serverport,B_QUIT_REQUESTED,NULL,0);
|
write_port(serverport,B_QUIT_REQUESTED,NULL,0);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user