From 8104bd54225e61f18536dc6a41eb30fb7ae92187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 2 May 2010 17:12:33 +0000 Subject: [PATCH] * 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 --- src/servers/app/Desktop.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index f61959a143..9823a38939 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -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);