Convert coords of B_MOUSE_IDLE in _SanitizeMessage()
When BWindow receives a message in screen coordinates and the message has a target view, as it does when the message comes from App Server, convert the coordinates to view coordinates before passing the message along. Revert the portion of hrev46532 where BView converts screen coordinates and converts them since that happens in BWindow::_SanatizeMessage() now.
This commit is contained in:
parent
19360a8c07
commit
cf9414ff69
@ -4324,12 +4324,8 @@ BView::MessageReceived(BMessage* message)
|
||||
case B_MOUSE_IDLE:
|
||||
{
|
||||
BPoint where;
|
||||
if (message->FindPoint("be:view_where", &where) != B_OK) {
|
||||
if (message->FindPoint("screen_where", &where) != B_OK)
|
||||
break;
|
||||
else
|
||||
ConvertFromScreen(&where);
|
||||
}
|
||||
if (message->FindPoint("be:view_where", &where) != B_OK)
|
||||
break;
|
||||
|
||||
BToolTip* tip;
|
||||
if (GetToolTipAt(where, &tip))
|
||||
|
@ -3521,6 +3521,23 @@ BWindow::_SanitizeMessage(BMessage* message, BHandler* target, bool usePreferred
|
||||
break;
|
||||
}
|
||||
|
||||
case B_MOUSE_IDLE:
|
||||
{
|
||||
// App Server sends screen coordinates, convert the point to
|
||||
// local view coordinates, then add the point in be:view_where
|
||||
BPoint where;
|
||||
if (message->FindPoint("screen_where", &where) != B_OK)
|
||||
break;
|
||||
|
||||
BView* view = dynamic_cast<BView*>(target);
|
||||
if (view != NULL) {
|
||||
// add local view coordinates
|
||||
message->AddPoint("be:view_where",
|
||||
view->ConvertFromScreen(where));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case _MESSAGE_DROPPED_:
|
||||
{
|
||||
uint32 originalWhat;
|
||||
|
Loading…
Reference in New Issue
Block a user