From 61d65d37ea714f816b2024842d4b48152ef07b4a Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Sat, 5 Feb 2005 21:38:24 +0000 Subject: [PATCH] GetMouse works properly git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11264 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/View.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index 0926b22b46..e482c3daa1 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -1230,13 +1230,18 @@ BView::GetMouse(BPoint *location, uint32 *buttons, bool checkMessageQueue) // If B_MOUSE_UP or B_MOUSE_MOVED has not been found in the message queue, // tell app_server to send us the current mouse coords and buttons. 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(owner->fLink->GetReplyPort()); owner->fLink->Flush(); - + int32 rCode = SERVER_FALSE; owner->fLink->GetNextReply(&rCode); if (rCode == SERVER_TRUE) { owner->fLink->Read(location); - owner->fLink->Read((int32 *)buttons); + owner->fLink->Read((int32 *)buttons,sizeof(int32)); } }