* Always set the focus to the moved window on workspace switch.

* This fixes a part of ticket #5675.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36584 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-05-02 17:12:33 +00:00
parent f23be5bbed
commit 8104bd5422
1 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2009, Haiku.
* Copyright 2001-2010, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -3251,8 +3251,10 @@ Desktop::_SetWorkspace(int32 index, bool moveFocusWindow)
}
// Set new focus, but keep focus to a floating window if still visible
if (!_Windows(index).HasWindow(FocusWindow())
|| !FocusWindow()->IsFloating())
if (movedWindow != NULL)
SetFocusWindow(movedWindow);
else if (!_Windows(index).HasWindow(FocusWindow())
|| (FocusWindow() != NULL && !FocusWindow()->IsFloating()))
SetFocusWindow(fLastWorkspaceFocus[index]);
_WindowChanged(NULL);