Implemented AS_COUNT_WORKSPACES and AS_SET_WORKSPACE_COUNT server side.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15253 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-11-30 22:48:13 +00:00
parent c8b8bbfca4
commit a8b49ab310
3 changed files with 47 additions and 5 deletions

View File

@ -547,6 +547,22 @@ RootLayer::_WindowsChanged(BRegion& region)
}
void
RootLayer::UpdateWorkspaces()
{
BAutolock _(fAllRegionsLock);
if (fWorkspacesLayer == NULL)
return;
BRegion changed;
_WindowsChanged(changed);
MarkForRedraw(changed);
TriggerRedraw();
}
WindowLayer*
RootLayer::WindowAt(BPoint where)
{
@ -562,9 +578,6 @@ RootLayer::WindowAt(BPoint where)
}
// #pragma mark - Input related methods
void
RootLayer::SetMouseEventWindow(WindowLayer* window)
{

View File

@ -87,6 +87,8 @@ class RootLayer : public Layer {
void SetWindowLayerFeel(WindowLayer *windowLayer, int32 newFeel);
void SetWindowLayerLook(WindowLayer *windowLayer, int32 newLook);
void UpdateWorkspaces();
void MarkForRedraw(const BRegion &dirty);
void TriggerRedraw();

View File

@ -845,15 +845,42 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
break;
}
#endif
case AS_CURRENT_WORKSPACE:
case AS_COUNT_WORKSPACES:
{
DesktopSettings settings(fDesktop);
fLink.StartMessage(B_OK);
fLink.Attach<int32>(settings.WorkspacesCount());
fLink.Flush();
break;
}
case AS_SET_WORKSPACE_COUNT:
{
DesktopSettings settings(fDesktop);
int32 newCount;
if (link.Read<int32>(&newCount) == B_OK) {
settings.SetWorkspacesCount(newCount);
// either update the workspaces window, or switch to
// the last available workspace - which will update
// the workspaces window automatically
if (fDesktop->CurrentWorkspace() >= newCount)
fDesktop->SetWorkspace(newCount - 1);
else
fDesktop->RootLayer()->UpdateWorkspaces();
}
break;
}
case AS_CURRENT_WORKSPACE:
STRACE(("ServerApp %s: get current workspace\n", Signature()));
fLink.StartMessage(B_OK);
fLink.Attach<int32>(fDesktop->CurrentWorkspace());
fLink.Flush();
break;
}
case AS_ACTIVATE_WORKSPACE:
{