From a6dd420a2b2ee8049b3d3e7df307ffee7e00e300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 3 Jan 2006 23:14:34 +0000 Subject: [PATCH] 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 --- src/kits/interface/View.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index 2e4c0734e0..4c00f1c73c 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -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(mask); fOwner->fLink->Attach(options); return B_OK; } + return B_ERROR; }