From c73be1e843d52d852cfae5aa94f0d2b12dfc5b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 7 Nov 2008 11:36:22 +0000 Subject: [PATCH] * When switching to a workspace a window is on in ActivateWindow(), only consider the workspaces in the configured count. * If the window is not on the current workspace after the workspace check, always move it to the current instead. This lets windows on workspaces outside of the ones currently configured show up on the current workspace as if they had the B_NOT_ANCHORED_ON_ACTIVATE flag set. * This fixes bug #3003. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28549 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Desktop.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index 88c1cf7bad..c69263c0ea 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -1489,7 +1489,7 @@ Desktop::SetFocusLocked(const Window* window) fLockedFocusWindow = window; } - + void Desktop::_BringWindowsToFront(WindowList& windows, int32 list, @@ -1559,13 +1559,13 @@ Desktop::ActivateWindow(Window* window) return; bool windowOnOtherWorkspace = !window->InWorkspace(fCurrentWorkspace); - if (windowOnOtherWorkspace) { - if ((window->Flags() & B_NO_WORKSPACE_ACTIVATION) == 0 - && (window->Flags() & B_NOT_ANCHORED_ON_ACTIVATE) == 0) { - // switch to the workspace on which this window is + if (windowOnOtherWorkspace + && (window->Flags() & B_NOT_ANCHORED_ON_ACTIVATE) == 0) { + if ((window->Flags() & B_NO_WORKSPACE_ACTIVATION) == 0) { + // Switch to the workspace on which this window is // (we'll take the first one that the window is on) uint32 workspaces = window->Workspaces(); - for (int32 i = 0; i < 32; i++) { + for (int32 i = 0; i < fSettings->WorkspacesCount(); i++) { uint32 workspace = workspace_to_workspaces(i); if (workspaces & workspace) { SetWorkspace(i); @@ -1573,15 +1573,14 @@ Desktop::ActivateWindow(Window* window) break; } } - } else if ((window->Flags() & B_NOT_ANCHORED_ON_ACTIVATE) == 0) { + } else { UnlockAllWindows(); return; } } - if (windowOnOtherWorkspace - && (window->Flags() & B_NOT_ANCHORED_ON_ACTIVATE) != 0) { - // bring the window to the current workspace + if (windowOnOtherWorkspace) { + // Bring the window to the current workspace // TODO: what if this window is on multiple workspaces?!? uint32 workspaces = workspace_to_workspaces(fCurrentWorkspace); SetWindowWorkspaces(window, workspaces);