From 39b345c7b634a8c5f3748d980b0e0cc4ea1655a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 25 Nov 2005 16:11:19 +0000 Subject: [PATCH] Added temporary hack so that windows don't get mouse messages if the cursor is not over them - this should be better integrated with the rest of the code (later, when we don't rely on RootLayer for everything anymore). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15151 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/EventDispatcher.cpp | 16 ++++++++++++++++ src/servers/app/EventDispatcher.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/servers/app/EventDispatcher.cpp b/src/servers/app/EventDispatcher.cpp index f5d9e6b0e2..47ea1ef704 100644 --- a/src/servers/app/EventDispatcher.cpp +++ b/src/servers/app/EventDispatcher.cpp @@ -369,6 +369,7 @@ EventDispatcher::SetFocus(const BMessenger* messenger) } else fFocus = NULL; + fFocusGotExitTransit = true; fTransit = true; } @@ -765,9 +766,24 @@ EventDispatcher::_EventLoop() pointerEvent = true; if (fFocus != NULL) { + int32 viewToken; + addedTokens |= _AddTokens(event, fFocus, B_POINTER_EVENTS); if (addedTokens) _SetFeedFocus(event); + else if (fFocusGotExitTransit) { + // TODO: this is a temporary hack to not continue to + // send mouse messages to the client when the mouse + // pointer is not over it + if (event->FindInt32("_view_token", &viewToken) != B_OK) + break; + + fFocusGotExitTransit = false; + } else if (event->what == B_MOUSE_MOVED) { + if (event->FindInt32("_view_token", &viewToken) != B_OK) + fFocusGotExitTransit = true; + } + _SendMessage(fFocus->Messenger(), event, event->what == B_MOUSE_MOVED ? kMouseMovedImportance : kStandardImportance); } diff --git a/src/servers/app/EventDispatcher.h b/src/servers/app/EventDispatcher.h index f0435b7ed6..5c2a943678 100644 --- a/src/servers/app/EventDispatcher.h +++ b/src/servers/app/EventDispatcher.h @@ -82,6 +82,7 @@ class EventDispatcher : public BLocker { Target* fFocus; Target* fLastFocus; bool fTransit; + bool fFocusGotExitTransit; bool fSuspendFocus; BMessageFilter* fMouseFilter;