From 0a51dbde98d0d46c22e46a455ee04398e9781db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 2 May 2010 17:15:13 +0000 Subject: [PATCH] * Unified the Desktop and ServerApp AS_ACTIVATE_WORKSPACE to work in the same way. * Use that newly exposed feature of taking the focus window to the new workspace when using the Ctrl-Alt-Shift-Arrow shortcut. * This fixes #5675. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36585 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/InterfaceDefs.cpp | 1 + src/kits/interface/Window.cpp | 23 ++++++----------------- src/servers/app/ServerApp.cpp | 5 ++++- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/kits/interface/InterfaceDefs.cpp b/src/kits/interface/InterfaceDefs.cpp index e50940e4e4..05a871fcf4 100644 --- a/src/kits/interface/InterfaceDefs.cpp +++ b/src/kits/interface/InterfaceDefs.cpp @@ -804,6 +804,7 @@ activate_workspace(int32 workspace) BPrivate::AppServerLink link; link.StartMessage(AS_ACTIVATE_WORKSPACE); link.Attach(workspace); + link.Attach(false); link.Flush(); } diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index fc33a4a0a7..7535acd3c9 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2009, Haiku. + * Copyright 2001-2010, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -941,22 +941,11 @@ BWindow::DispatchMessage(BMessage* msg, BHandler* target) int32 next = nextColumn + nextRow * columns; if (next != current) { - uint32 workspaces = 0; - if (takeMeThere) { - workspaces = Workspaces() | (1 << next); - - // add the next workspaces to the workspaces - if (workspaces != Workspaces()) - SetWorkspaces(workspaces); - } - - // switch to it - activate_workspace(next); - - if (takeMeThere && workspaces != B_ALL_WORKSPACES) { - workspaces &= ~(1 << current); - SetWorkspaces(workspaces); - } + BPrivate::AppServerLink link; + link.StartMessage(AS_ACTIVATE_WORKSPACE); + link.Attach(next); + link.Attach(true); + link.Flush(); } break; } diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index 4323db28d8..4f47c92dfb 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -910,7 +910,10 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) int32 index; link.Read(&index); - fDesktop->SetWorkspace(index); + bool takeFocusWindowThere; + link.Read(&takeFocusWindowThere); + + fDesktop->SetWorkspace(index, takeFocusWindowThere); break; }