From 350b87c7d22c9fccaecd4950e6424fb83563877c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Mon, 13 Oct 2008 23:16:30 +0000 Subject: [PATCH] zooey + axeld + stippi: Fixed a problem with dispatching B_MOUSE_MOVED messages to views which need the transit event: * If the app_server decided to send a B_MOUSE_MOVED to the previous mouse containing window, it forgot to add the _feed_focus flag, which was a problem if the message actually happened to contain tokens (views that registered for events.) On the client side, only those views would receive the message, while the regular last mouse moved view would not be notified at all. * On the client side, never change fLastMouseMovedView if the message is not targeted at the preferred handler. In the above situation, any "registered for events views" would receive the message first, but viewUnderMouse would be NULL and then when the regular last mouse moved view received it, it resulted in the wrong transit (B_OUTSIDE_VIEW instead of B_EXITED_VIEW). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28059 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Window.cpp | 2 +- src/servers/app/EventDispatcher.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 3046373bb4..049beb1368 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -3143,7 +3143,7 @@ BWindow::_SanitizeMessage(BMessage* message, BHandler* target, bool usePreferred uint32 transit = _TransitForMouseMoved(view, viewUnderMouse);; message->AddInt32("be:transit", transit); - if (usePreferred || viewUnderMouse == NULL) + if (usePreferred) fLastMouseMovedView = viewUnderMouse; } } diff --git a/src/servers/app/EventDispatcher.cpp b/src/servers/app/EventDispatcher.cpp index 0efb2a4764..c8f8e183a2 100644 --- a/src/servers/app/EventDispatcher.cpp +++ b/src/servers/app/EventDispatcher.cpp @@ -814,6 +814,8 @@ EventDispatcher::_EventLoop() // that the mouse has exited its views addedTokens = _AddTokens(event, fPreviousMouseTarget, B_POINTER_EVENTS); + if (addedTokens) + _SetFeedFocus(event); _SendMessage(fPreviousMouseTarget->Messenger(), event, kMouseTransitImportance);