* In FFM mode, when a window was closed, or the workspace was changed, the

window under the mouse was given focus. This makes using FFM with the keyboard
  alone very inconvenient to use, which is why now the window that previously
  had focus will regain it instead; as soon as you actually move the mouse, the
  focus is changed as usual.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32014 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-07-31 11:58:59 +00:00
parent fa770e4c84
commit c6906c2832
3 changed files with 14 additions and 9 deletions

View File

@ -236,7 +236,8 @@ MouseFilter::Filter(BMessage* message, EventTarget** _target, int32* _viewToken,
case B_MOUSE_MOVED:
window->MouseMoved(message, where, &viewToken,
latestMouseMoved == NULL || latestMouseMoved == message);
latestMouseMoved == NULL || latestMouseMoved == message,
false);
break;
}
@ -1394,8 +1395,7 @@ Desktop::RemoveWorkspacesView(WorkspacesView* view)
}
/*!
\brief Sends a fake B_MOUSE_MOVED event to the window under the mouse,
/*! \brief Sends a fake B_MOUSE_MOVED event to the window under the mouse,
and also updates the current view under the mouse.
This has only to be done in case the view changed without user interaction,
@ -1416,7 +1416,8 @@ Desktop::_SendFakeMouseMoved(Window* window)
if (window != NULL) {
BMessage message;
window->MouseMoved(&message, fLastMousePosition, &viewToken, true);
window->MouseMoved(&message, fLastMousePosition, &viewToken, true,
true);
if (viewToken != B_NULL_TOKEN)
target = &window->EventTarget();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2009, Haiku, Inc.
* Copyright 2001-2009, Haiku, Inc.
* Distributed under the terms of the MIT license.
*
* Authors:
@ -981,7 +981,7 @@ Window::MouseUp(BMessage* message, BPoint where, int32* _viewToken)
void
Window::MouseMoved(BMessage *message, BPoint where, int32* _viewToken,
bool isLatestMouseMoved)
bool isLatestMouseMoved, bool isFake)
{
#if 0
if (fDecorator != NULL && fTopView != NULL) {
@ -1110,7 +1110,10 @@ Window::MouseMoved(BMessage *message, BPoint where, int32* _viewToken,
DesktopSettings desktopSettings(fDesktop);
if (desktopSettings.FocusFollowsMouse()
&& !IsFocus() && !(Flags() & B_AVOID_FOCUS)) {
fDesktop->SetFocusWindow(this);
// 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 : this);
}
// mouse cursor

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2009, Haiku, Inc.
* Copyright 2001-2009, Haiku, Inc.
* Distributed under the terms of the MIT license.
*
* Authors:
@ -139,7 +139,8 @@ public:
void MouseUp(BMessage* message, BPoint where,
int32* _viewToken);
void MouseMoved(BMessage* message, BPoint where,
int32* _viewToken, bool isLatestMouseMoved);
int32* _viewToken, bool isLatestMouseMoved,
bool isFake);
// some hooks to inform the client window
// TODO: move this to ServerWindow maybe?