From 2ee2a8ede44354c9227d02979bf8effaf0e04b2c Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 25 Nov 2010 16:41:22 +0000 Subject: [PATCH] In FFM mode always update the focus in MouseMoved() regardless of the state. I broke that with r39608. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39629 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/DefaultWindowBehaviour.cpp | 29 ++++++++-------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/servers/app/DefaultWindowBehaviour.cpp b/src/servers/app/DefaultWindowBehaviour.cpp index f9416d505c..d3ebd84e28 100644 --- a/src/servers/app/DefaultWindowBehaviour.cpp +++ b/src/servers/app/DefaultWindowBehaviour.cpp @@ -70,19 +70,6 @@ struct DefaultWindowBehaviour::State { { } - void UpdateFFMFocus(bool isFake) - { - // change focus in FFM mode - DesktopSettings desktopSettings(fDesktop); - if (desktopSettings.FocusFollowsMouse() - && !fWindow->IsFocus() && !(fWindow->Flags() & B_AVOID_FOCUS)) { - // If the mouse move is a fake one, we set the focus to NULL, which - // will cause the window that had focus last to retrieve it again - this - // makes FFM much nicer to use with the keyboard. - fDesktop->SetFocusWindow(isFake ? NULL : fWindow); - } - } - protected: DefaultWindowBehaviour& fBehavior; Window* fWindow; @@ -184,9 +171,6 @@ struct DefaultWindowBehaviour::MouseTrackingState : State { // set the new mouse position fLastMousePosition += delta; - - // update the FFM focus - UpdateFFMFocus(isFake); } virtual void MouseMovedAction(BPoint& delta, bigtime_t now) @@ -574,9 +558,6 @@ struct DefaultWindowBehaviour::DecoratorButtonState : State { virtual void MouseMoved(BMessage* message, BPoint where, bool isFake) { _RedrawDecorator(message); - - // update the FFM focus - UpdateFFMFocus(isFake); } private: @@ -831,6 +812,16 @@ DefaultWindowBehaviour::MouseMoved(BMessage *message, BPoint where, bool isFake) { if (fState != NULL) fState->MouseMoved(message, where, isFake); + + // change focus in FFM mode + DesktopSettings desktopSettings(fDesktop); + if (desktopSettings.FocusFollowsMouse() + && !fWindow->IsFocus() && !(fWindow->Flags() & B_AVOID_FOCUS)) { + // If the mouse move is a fake one, we set the focus to NULL, which + // will cause the window that had focus last to retrieve it again - this + // makes FFM much nicer to use with the keyboard. + fDesktop->SetFocusWindow(isFake ? NULL : fWindow); + } }