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
This commit is contained in:
Axel Dörfler 2005-11-25 16:11:19 +00:00
parent fa2c53ed52
commit 39b345c7b6
2 changed files with 17 additions and 0 deletions

View File

@ -369,6 +369,7 @@ EventDispatcher::SetFocus(const BMessenger* messenger)
} else } else
fFocus = NULL; fFocus = NULL;
fFocusGotExitTransit = true;
fTransit = true; fTransit = true;
} }
@ -765,9 +766,24 @@ EventDispatcher::_EventLoop()
pointerEvent = true; pointerEvent = true;
if (fFocus != NULL) { if (fFocus != NULL) {
int32 viewToken;
addedTokens |= _AddTokens(event, fFocus, B_POINTER_EVENTS); addedTokens |= _AddTokens(event, fFocus, B_POINTER_EVENTS);
if (addedTokens) if (addedTokens)
_SetFeedFocus(event); _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 _SendMessage(fFocus->Messenger(), event, event->what == B_MOUSE_MOVED
? kMouseMovedImportance : kStandardImportance); ? kMouseMovedImportance : kStandardImportance);
} }

View File

@ -82,6 +82,7 @@ class EventDispatcher : public BLocker {
Target* fFocus; Target* fFocus;
Target* fLastFocus; Target* fLastFocus;
bool fTransit; bool fTransit;
bool fFocusGotExitTransit;
bool fSuspendFocus; bool fSuspendFocus;
BMessageFilter* fMouseFilter; BMessageFilter* fMouseFilter;