From d69a73dfc7ce6f8340ea7df1fe67986b01aa09ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 16 May 2009 21:09:33 +0000 Subject: [PATCH] * The Be API requires that options and mask is 0 to remove a mask using BView::SetEventMask(). This fixes bug #3928. * And while the app_server handled that correctly, BView actually did not, and stored the wrong value. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30772 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/desklink/VolumeControl.cpp | 5 ++++- src/kits/interface/View.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/bin/desklink/VolumeControl.cpp b/src/bin/desklink/VolumeControl.cpp index ac08e3c6a7..380cee0dec 100644 --- a/src/bin/desklink/VolumeControl.cpp +++ b/src/bin/desklink/VolumeControl.cpp @@ -104,7 +104,10 @@ VolumeControl::AttachedToWindow() { BSlider::AttachedToWindow(); - SetEventMask(_IsReplicant() ? 0 : B_POINTER_EVENTS, B_NO_POINTER_HISTORY); + if (_IsReplicant()) + SetEventMask(0, 0); + else + SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY); BMediaRoster* roster = BMediaRoster::CurrentRoster(); if (roster != NULL && fMixerControl->GainNode() != media_node::null) { diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index d8d0dd765a..05a665f7ca 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008, Haiku. + * Copyright 2001-2009, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -1587,7 +1587,9 @@ BView::SetEventMask(uint32 mask, uint32 options) if (fEventMask == mask && fEventOptions == options) return B_OK; - fEventMask = mask | (fEventMask & 0xffff0000); + // don't change the mask if it's zero and we've got options + if (mask != 0 || options == 0) + fEventMask = mask | (fEventMask & 0xffff0000); fEventOptions = options; fState->archiving_flags |= B_VIEW_EVENT_MASK_BIT;