* Fixed some obvious misbehaviour of the switcher.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28941 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-01-18 22:53:31 +00:00
parent d14a541795
commit 94c366d233
+12 -6
View File
@@ -614,7 +614,7 @@ TSwitchManager::_SortApps()
{ {
team_id* teams; team_id* teams;
int32 count; int32 count;
if (BPrivate::get_application_order(B_CURRENT_WORKSPACE, &teams, &count) if (BPrivate::get_application_order(current_workspace(), &teams, &count)
!= B_OK) != B_OK)
return; return;
@@ -651,7 +651,7 @@ TSwitchManager::_GetSortedWindowTokens(int32** _tokens, int32* _count)
{ {
int32* ordered; int32* ordered;
int32 orderedCount; int32 orderedCount;
status_t status = BPrivate::get_window_order(B_CURRENT_WORKSPACE, &ordered, status_t status = BPrivate::get_window_order(current_workspace(), &ordered,
&orderedCount); &orderedCount);
if (status != B_OK) if (status != B_OK)
return status; return status;
@@ -945,13 +945,14 @@ TSwitchManager::ActivateApp(bool forceShow, bool allowWorkspaceSwitch)
} }
int32 currentWorkspace = current_workspace(); int32 currentWorkspace = current_workspace();
TTeamGroup *teamGroup = (TTeamGroup *)fGroupList.ItemAt(fCurrentIndex); TTeamGroup* teamGroup = (TTeamGroup*)fGroupList.ItemAt(fCurrentIndex);
// Let's handle the easy case first: There's only 1 team in the group // Let's handle the easy case first: There's only 1 team in the group
if (teamGroup->TeamList()->CountItems() == 1) { if (teamGroup->TeamList()->CountItems() == 1) {
bool result; bool result;
if (forceShow && (fCurrentWindow != 0 || windowInfo->is_mini)) if (forceShow && (fCurrentWindow != 0 || windowInfo->is_mini)) {
do_window_action(windowInfo->server_token, B_BRING_TO_FRONT, do_window_action(windowInfo->server_token, B_BRING_TO_FRONT,
BRect(0, 0, 0, 0), false); BRect(0, 0, 0, 0), false);
}
if (!forceShow && windowInfo->is_mini) { if (!forceShow && windowInfo->is_mini) {
// we aren't unhiding minimized windows, so we can't do // we aren't unhiding minimized windows, so we can't do
@@ -999,8 +1000,13 @@ TSwitchManager::ActivateApp(bool forceShow, bool allowWorkspaceSwitch)
} }
int32 tokenCount; int32 tokenCount;
int32 *tokens = get_token_list(-1, &tokenCount); #ifdef __HAIKU__
if (!tokens) { int32* tokens = NULL;
_GetSortedWindowTokens(&tokens, &tokenCount);
#else
int32* tokens = get_token_list(-1, &tokenCount);
#endif
if (tokens == NULL) {
ASSERT(windowInfo); ASSERT(windowInfo);
free(windowInfo); free(windowInfo);
return true; // weird error, so don't try to recover return true; // weird error, so don't try to recover