* In normal mouse mode, the focus list is no longer used to find the
next window to get focus after the current one is gone. This fixes the strange behaviour when using right-click to send the current window to the back. * When FFM is active, Desktop::SendWindowBehind() will now choose the new focus window to be the one under the mouse, overriding the focus list. * Desktop::SendWindowBehind() will now also call _SendFakeMouseMoved() if necessary. * Removed Desktop::fFocusFollowsMouse; it was not used or maintained anywhere. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24269 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -322,8 +322,6 @@ Desktop::Desktop(uid_t userID)
|
||||
|
||||
fWindowLock("window lock"),
|
||||
|
||||
fFocusFollowsMouse(false),
|
||||
|
||||
fMouseEventWindow(NULL),
|
||||
fWindowUnderMouse(NULL),
|
||||
fViewUnderMouse(B_NULL_TOKEN),
|
||||
@@ -1316,7 +1314,7 @@ Desktop::SetFocusWindow(WindowLayer* focus)
|
||||
|
||||
bool hasModal = _WindowHasModal(focus);
|
||||
|
||||
// TODO: test for FFM and B_LOCK_WINDOW_FOCUS
|
||||
// TODO: test for B_LOCK_WINDOW_FOCUS
|
||||
|
||||
if (focus == fFocus && focus != NULL && !focus->IsHidden()
|
||||
&& (focus->Flags() & B_AVOID_FOCUS) == 0 && !hasModal) {
|
||||
@@ -1325,8 +1323,22 @@ Desktop::SetFocusWindow(WindowLayer* focus)
|
||||
return;
|
||||
}
|
||||
|
||||
if (focus == NULL || hasModal)
|
||||
uint32 list = fCurrentWorkspace;
|
||||
|
||||
if (fSettings->FocusFollowsMouse())
|
||||
list = kFocusList;
|
||||
|
||||
if (focus == NULL || hasModal) {
|
||||
if (!fSettings->FocusFollowsMouse()) {
|
||||
focus = FrontWindow();
|
||||
if (focus == NULL) {
|
||||
// there might be no front window in case of only a single
|
||||
// window with B_FLOATING_ALL_WINDOW_FEEL
|
||||
focus = _CurrentWindows().LastWindow();
|
||||
}
|
||||
} else
|
||||
focus = fFocusList.LastWindow();
|
||||
}
|
||||
|
||||
// make sure no window is chosen that doesn't want focus or cannot have it
|
||||
while (focus != NULL
|
||||
@@ -1334,7 +1346,7 @@ Desktop::SetFocusWindow(WindowLayer* focus)
|
||||
|| (focus->Flags() & B_AVOID_FOCUS) != 0
|
||||
|| _WindowHasModal(focus)
|
||||
|| focus->IsHidden())) {
|
||||
focus = focus->PreviousWindow(kFocusList);
|
||||
focus = focus->PreviousWindow(list);
|
||||
}
|
||||
|
||||
if (fFocus == focus) {
|
||||
@@ -1571,10 +1583,19 @@ Desktop::SendWindowBehind(WindowLayer* window, WindowLayer* behindOf)
|
||||
MarkDirty(dirty);
|
||||
|
||||
_UpdateFronts();
|
||||
SetFocusWindow();
|
||||
SetFocusWindow(fSettings->FocusFollowsMouse() ?
|
||||
WindowAt(fLastMousePosition) : NULL);
|
||||
|
||||
bool sendFakeMouseMoved = false;
|
||||
if (FocusWindow() != window)
|
||||
sendFakeMouseMoved = true;
|
||||
|
||||
_WindowChanged(window);
|
||||
|
||||
UnlockAllWindows();
|
||||
|
||||
if (sendFakeMouseMoved)
|
||||
_SendFakeMouseMoved();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -269,8 +269,6 @@ class Desktop : public MessageLooper, public ScreenOwner {
|
||||
BRegion fBackgroundRegion;
|
||||
BRegion fScreenRegion;
|
||||
|
||||
bool fFocusFollowsMouse;
|
||||
|
||||
WindowLayer* fMouseEventWindow;
|
||||
const WindowLayer* fWindowUnderMouse;
|
||||
int32 fViewUnderMouse;
|
||||
|
||||
@@ -812,7 +812,7 @@ WindowLayer::MouseDown(BMessage* message, BPoint where, int32* _viewToken)
|
||||
|
||||
// activate window if not in FFM mode
|
||||
DesktopSettings desktopSettings(fDesktop);
|
||||
if (desktopSettings.MouseMode() == B_NORMAL_MOUSE) {
|
||||
if (!desktopSettings.FocusFollowsMouse()) {
|
||||
fDesktop->ActivateWindow(this);
|
||||
} else {
|
||||
// actually, the window should already be
|
||||
@@ -838,7 +838,7 @@ WindowLayer::MouseDown(BMessage* message, BPoint where, int32* _viewToken)
|
||||
// Activate window in case it doesn't accept first click, and
|
||||
// we're not in FFM mode
|
||||
if ((Flags() & B_WILL_ACCEPT_FIRST_CLICK) == 0
|
||||
&& desktopSettings.MouseMode() == B_NORMAL_MOUSE)
|
||||
&& !desktopSettings.FocusFollowsMouse())
|
||||
fDesktop->ActivateWindow(this);
|
||||
|
||||
// Eat the click if we don't accept first click
|
||||
@@ -1046,7 +1046,7 @@ WindowLayer::MouseMoved(BMessage *message, BPoint where, int32* _viewToken,
|
||||
|
||||
// change focus in FFM mode
|
||||
DesktopSettings desktopSettings(fDesktop);
|
||||
if (desktopSettings.MouseMode() != B_NORMAL_MOUSE
|
||||
if (desktopSettings.FocusFollowsMouse()
|
||||
&& !IsFocus() && !(Flags() & B_AVOID_FOCUS)) {
|
||||
fDesktop->SetFocusWindow(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user