It's okay that SetMouseEventMask() doesn't do anything when called outside

BView::MouseDown() - or when it's not attached to a view - but it shouldn't
drop into the debugger in either case.
This fixes the desklink volume slider.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15831 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-01-03 23:14:34 +00:00
parent 41d9fd9ce4
commit a6dd420a2b
1 changed files with 6 additions and 5 deletions

View File

@ -1520,18 +1520,19 @@ BView::EventMask()
status_t
BView::SetMouseEventMask(uint32 mask, uint32 options)
{
// fEventMask = (mask << 16) | (fEventMask & 0x0000FFFF);
// fEventOptions = (options << 16) | (options & 0x0000FFFF);
if (do_owner_check()
&& fOwner->CurrentMessage()
// Just don't do anything if the view is not yet attached
// or we were called outside of BView::MouseDown()
if (fOwner != NULL
&& fOwner->CurrentMessage() != NULL
&& fOwner->CurrentMessage()->what == B_MOUSE_DOWN) {
check_lock();
fOwner->fLink->StartMessage(AS_LAYER_SET_MOUSE_EVENT_MASK);
fOwner->fLink->Attach<uint32>(mask);
fOwner->fLink->Attach<uint32>(options);
return B_OK;
}
return B_ERROR;
}