* If a BView::SetMouseEventMask() arrived in the app_server after the mouse buttons

have already been released again, the temporary listener was still added.
  This fixes bug #727.
* No longer removes temporary listeners if there are mouse buttons left pressed; ie.
  if you press two buttons at once, the listeners are now only removed after you've
  released them both. This is not only more logical, it's also how BeOS behaves :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18483 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-08-11 14:24:42 +00:00
parent a5210ab17d
commit 93d0415885

View File

@ -352,6 +352,11 @@ EventDispatcher::_AddListener(EventTarget& target, int32 token,
{
BAutolock _(this);
if (temporary && fLastButtons == 0) {
// only allow to add temporary listeners in case a buttons is pressed
return false;
}
if (!fTargets.HasItem(&target))
fTargets.AddItem(&target);
@ -746,7 +751,7 @@ EventDispatcher::_EventLoop()
fNextLatestMouseMoved) == B_SKIP_MESSAGE) {
// this is a work-around if the wrong B_MOUSE_UP
// event is filtered out
if (event->what == B_MOUSE_UP) {
if (event->what == B_MOUSE_UP && event->FindInt32("buttons") == 0) {
fSuspendFocus = false;
_RemoveTemporaryListeners();
}
@ -874,7 +879,8 @@ EventDispatcher::_EventLoop()
}
}
if (event->what == B_MOUSE_UP) {
if (event->what == B_MOUSE_UP && fLastButtons == 0) {
// no buttons are pressed anymore
fSuspendFocus = false;
_RemoveTemporaryListeners();
if (fDraggingMessage)