Added server support for activate_workspace(). Looks like it's not doing anything, though SetActiveWorkspace() returns true....
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13103 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -574,13 +574,12 @@ set_workspace_count(int32 count)
|
|||||||
_IMPEXP_BE int32
|
_IMPEXP_BE int32
|
||||||
current_workspace()
|
current_workspace()
|
||||||
{
|
{
|
||||||
int32 index = 1;
|
int32 index = 0;
|
||||||
|
|
||||||
BAppServerLink link;
|
BAppServerLink link;
|
||||||
int32 code;
|
int32 code;
|
||||||
link.StartMessage(AS_CURRENT_WORKSPACE);
|
link.StartMessage(AS_CURRENT_WORKSPACE);
|
||||||
link.FlushWithReply(&code);
|
if (link.FlushWithReply(&code) == B_OK && code == SERVER_TRUE)
|
||||||
if(code==SERVER_TRUE)
|
|
||||||
link.Read<int32>(&index);
|
link.Read<int32>(&index);
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
|
|||||||
@@ -657,17 +657,35 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &link)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case AS_CURRENT_WORKSPACE:
|
||||||
|
{
|
||||||
|
STRACE(("ServerApp %s: get current workspace\n", fSignature.String()));
|
||||||
|
|
||||||
|
// TODO: Locking this way is not nice
|
||||||
|
RootLayer *root = gDesktop->ActiveRootLayer();
|
||||||
|
root->Lock();
|
||||||
|
|
||||||
|
fLink.StartMessage(SERVER_TRUE);
|
||||||
|
fLink.Attach<int32>(root->ActiveWorkspaceIndex());
|
||||||
|
fLink.Flush();
|
||||||
|
|
||||||
|
root->Unlock();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case AS_ACTIVATE_WORKSPACE:
|
case AS_ACTIVATE_WORKSPACE:
|
||||||
{
|
{
|
||||||
STRACE(("ServerApp %s: Activate Workspace UNIMPLEMETED\n",fSignature.String()));
|
STRACE(("ServerApp %s: activate workspace\n", fSignature.String()));
|
||||||
|
|
||||||
// Attached data
|
|
||||||
// 1) int32 workspace index
|
|
||||||
|
|
||||||
// Error-checking is done in ActivateWorkspace, so this is a safe call
|
|
||||||
int32 workspace;
|
|
||||||
link.Read<int32>(&workspace);
|
|
||||||
|
|
||||||
|
// TODO: See above
|
||||||
|
int32 index;
|
||||||
|
link.Read<int32>(&index);
|
||||||
|
RootLayer *root = gDesktop->ActiveRootLayer();
|
||||||
|
root->Lock();
|
||||||
|
root->SetActiveWorkspace(index);
|
||||||
|
root->Unlock();
|
||||||
|
// no reply
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1773,23 +1791,7 @@ printf("ServerApp %s: AS_SCREEN_GET_MODE\n", fSignature.String());
|
|||||||
root->Unlock();
|
root->Unlock();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case AS_CURRENT_WORKSPACE:
|
|
||||||
{
|
|
||||||
STRACE(("ServerApp %s: get current workspace\n", fSignature.String()));
|
|
||||||
|
|
||||||
// TODO: See above
|
|
||||||
RootLayer *root = gDesktop->ActiveRootLayer();
|
|
||||||
root->Lock();
|
|
||||||
|
|
||||||
fLink.StartMessage(SERVER_TRUE);
|
|
||||||
fLink.Attach<int32>(root->ActiveWorkspaceIndex());
|
|
||||||
fLink.Flush();
|
|
||||||
|
|
||||||
root->Unlock();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printf("ServerApp %s received unhandled message code offset %s\n",
|
printf("ServerApp %s received unhandled message code offset %s\n",
|
||||||
fSignature.String(), MsgCodeToBString(code).String());
|
fSignature.String(), MsgCodeToBString(code).String());
|
||||||
|
|||||||
Reference in New Issue
Block a user