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:
@@ -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*
|
WindowLayer*
|
||||||
RootLayer::WindowAt(BPoint where)
|
RootLayer::WindowAt(BPoint where)
|
||||||
{
|
{
|
||||||
@@ -562,9 +578,6 @@ RootLayer::WindowAt(BPoint where)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - Input related methods
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RootLayer::SetMouseEventWindow(WindowLayer* window)
|
RootLayer::SetMouseEventWindow(WindowLayer* window)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ class RootLayer : public Layer {
|
|||||||
void SetWindowLayerFeel(WindowLayer *windowLayer, int32 newFeel);
|
void SetWindowLayerFeel(WindowLayer *windowLayer, int32 newFeel);
|
||||||
void SetWindowLayerLook(WindowLayer *windowLayer, int32 newLook);
|
void SetWindowLayerLook(WindowLayer *windowLayer, int32 newLook);
|
||||||
|
|
||||||
|
void UpdateWorkspaces();
|
||||||
|
|
||||||
void MarkForRedraw(const BRegion &dirty);
|
void MarkForRedraw(const BRegion &dirty);
|
||||||
void TriggerRedraw();
|
void TriggerRedraw();
|
||||||
|
|
||||||
|
|||||||
@@ -845,15 +845,42 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#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()));
|
STRACE(("ServerApp %s: get current workspace\n", Signature()));
|
||||||
|
|
||||||
fLink.StartMessage(B_OK);
|
fLink.StartMessage(B_OK);
|
||||||
fLink.Attach<int32>(fDesktop->CurrentWorkspace());
|
fLink.Attach<int32>(fDesktop->CurrentWorkspace());
|
||||||
fLink.Flush();
|
fLink.Flush();
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case AS_ACTIVATE_WORKSPACE:
|
case AS_ACTIVATE_WORKSPACE:
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user