Finally fixed Adi's repeatedly mentioned pet peeve: in AS_LAYER_GET_MOUSE_COORDS
communication, the port's reply port is no longer sent to the app_server (as it knows where to reply to, anyway). Also made sure the view's looper is locked while getting the coords - I guess BPortLink doesn't like to be written to from two different threads :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12742 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1205,15 +1205,14 @@ BView::GetMouse(BPoint *location, uint32 *buttons, bool checkMessageQueue)
|
||||
queue->Unlock();
|
||||
}
|
||||
|
||||
// Since we're usually called locked, this is mainly needed
|
||||
// in case we were called from another thread
|
||||
LockLooper();
|
||||
|
||||
// If no mouse update message has been found in the message queue,
|
||||
// we get the current mouse location and buttons from the app_server
|
||||
|
||||
owner->fLink->StartMessage(AS_LAYER_GET_MOUSE_COORDS);
|
||||
|
||||
// This is because BPortLink doesn't automatically attach the reply
|
||||
// port to a synchronous message. Bummer.
|
||||
// TODO: Fix BPortLink synchronous reply code
|
||||
owner->fLink->Attach<port_id>(owner->fLink->GetReplyPort());
|
||||
owner->fLink->Flush();
|
||||
|
||||
int32 rCode = SERVER_FALSE;
|
||||
@@ -1222,6 +1221,8 @@ BView::GetMouse(BPoint *location, uint32 *buttons, bool checkMessageQueue)
|
||||
owner->fLink->Read<BPoint>(location);
|
||||
owner->fLink->Read((int32 *)buttons, sizeof(int32));
|
||||
}
|
||||
|
||||
UnlockLooper();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user