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