The cmd+` shortcut wasn't taking into account if the user was currently holding a

window with the mouse, and as such didn't take it along to the new workspace
as the cmd+F# shortcuts do. Fixes #7057.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40070 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent 2011-01-02 16:04:15 +00:00
parent be4b43e03f
commit 5c9b247667
1 changed files with 3 additions and 3 deletions

View File

@ -189,6 +189,8 @@ KeyboardFilter::Filter(BMessage* message, EventTarget** _target,
return B_SKIP_MESSAGE; return B_SKIP_MESSAGE;
} }
bool takeWindow = (modifiers & B_SHIFT_KEY) != 0
|| fDesktop->MouseEventWindow() != NULL;
if (key >= B_F1_KEY && key <= B_F12_KEY) { if (key >= B_F1_KEY && key <= B_F12_KEY) {
// workspace change // workspace change
@ -201,8 +203,6 @@ KeyboardFilter::Filter(BMessage* message, EventTarget** _target,
{ {
STRACE(("Set Workspace %ld\n", key - 1)); STRACE(("Set Workspace %ld\n", key - 1));
bool takeWindow = (modifiers & B_SHIFT_KEY) != 0
|| fDesktop->MouseEventWindow() != NULL;
fDesktop->SetWorkspaceAsync(key - B_F1_KEY, takeWindow); fDesktop->SetWorkspaceAsync(key - B_F1_KEY, takeWindow);
return B_SKIP_MESSAGE; return B_SKIP_MESSAGE;
} }
@ -210,7 +210,7 @@ KeyboardFilter::Filter(BMessage* message, EventTarget** _target,
&& (modifiers & (B_COMMAND_KEY | B_CONTROL_KEY | B_OPTION_KEY)) && (modifiers & (B_COMMAND_KEY | B_CONTROL_KEY | B_OPTION_KEY))
== B_COMMAND_KEY) { == B_COMMAND_KEY) {
// switch to previous workspace (command + `) // switch to previous workspace (command + `)
fDesktop->SetWorkspaceAsync(-1, (modifiers & B_SHIFT_KEY) != 0); fDesktop->SetWorkspaceAsync(-1, takeWindow);
return B_SKIP_MESSAGE; return B_SKIP_MESSAGE;
} }
} }