Improved a bit BView::GetMouse(). Added more ToDOs

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12705 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2005-05-18 07:02:25 +00:00
parent e803c97c34
commit 898289a3f1

View File

@ -1180,7 +1180,8 @@ BView::GetMouse(BPoint *location, uint32 *buttons, bool checkMessageQueue)
// 3. We should maybe take care of more things as the window's loop is blocked. // 3. We should maybe take care of more things as the window's loop is blocked.
if (checkMessageQueue) { if (checkMessageQueue) {
BMessageQueue *queue = Window()->MessageQueue(); BWindow *window = Window();
BMessageQueue *queue = window->MessageQueue();
BMessage *msg; BMessage *msg;
int32 i = 0; int32 i = 0;
@ -1188,31 +1189,20 @@ BView::GetMouse(BPoint *location, uint32 *buttons, bool checkMessageQueue)
while ((msg = queue->FindMessage(i++)) != NULL) { while ((msg = queue->FindMessage(i++)) != NULL) {
switch (msg->what) { switch (msg->what) {
case B_MOUSE_UP:
{
msg->FindPoint("where", location);
msg->FindInt32("buttons", (int32*)buttons);
Window()->DispatchMessage(msg, Window());
queue->RemoveMessage(msg);
delete msg;
return;
}
case B_MOUSE_MOVED:
{
msg->FindPoint("where", location);
msg->FindInt32("buttons", (int32 *)buttons);
Window()->DispatchMessage(msg, Window());
queue->RemoveMessage(msg);
delete msg;
return;
}
case _UPDATE_: case _UPDATE_:
{ // TODO: This is probably not correct:
Window()->DispatchMessage(msg, Window()); // we should not dispatch the message but instead
// call the right function to update the views directly ?
window->DispatchMessage(msg, window);
// Fall through
case B_MOUSE_UP:
case B_MOUSE_MOVED:
// We need to eat up all these messages
queue->RemoveMessage(msg); queue->RemoveMessage(msg);
delete msg; delete msg;
return; break;
}
default: default:
break; break;
} }