The Workspaces window is now updated again. Only mouse clicks don't work yet.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15451 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-12-09 16:20:01 +00:00
parent 52d2c710bf
commit ce8c4d79fc
3 changed files with 36 additions and 13 deletions
+29 -12
View File
@@ -24,6 +24,7 @@
#include "ServerWindow.h"
#include "WindowLayer.h"
#include "Workspace.h"
#include "WorkspacesLayer.h"
#include <WindowInfo.h>
#include <ServerProtocol.h>
@@ -259,6 +260,7 @@ Desktop::Desktop(uid_t userID)
fShutdownSemaphore(-1),
fAllWindows(kAllWindowList),
fSubsetWindows(kSubsetList),
fWorkspacesLayer(NULL),
fActiveScreen(NULL),
fWindowLock("window lock")
{
@@ -563,11 +565,7 @@ Desktop::UpdateWorkspaces()
{
// TODO: maybe this should be replaced by a SetWorkspacesCount() method
/* if (fWorkspacesLayer == NULL)
return;
_WindowsChanged();
*/
_WindowChanged(NULL);
}
@@ -680,6 +678,8 @@ Desktop::SetWorkspace(int32 index)
if (!_Windows(index).HasWindow(FocusWindow()) || !FocusWindow()->IsFloating())
SetFocusWindow(FrontWindow());
_WindowChanged(NULL);
MarkDirty(dirty);
//_WindowsChanged();
@@ -867,6 +867,16 @@ Desktop::_WindowHasModal(WindowLayer* window)
}
void
Desktop::_WindowChanged(WindowLayer* window)
{
if (fWorkspacesLayer == NULL)
return;
fWorkspacesLayer->WindowChanged(window);
}
void
Desktop::SetFocusWindow(WindowLayer* focus)
{
@@ -929,6 +939,8 @@ Desktop::_BringWindowsToFront(WindowList& windows, int32 list,
_CurrentWindows().AddWindow(window,
window->Frontmost(_CurrentWindows().FirstWindow(),
fCurrentWorkspace));
_WindowChanged(window);
}
BRegion dummy;
@@ -1081,6 +1093,9 @@ Desktop::ShowWindow(WindowLayer* window)
return;
}
if (WorkspacesLayer* layer = dynamic_cast<WorkspacesLayer*>(window->TopLayer()))
fWorkspacesLayer = layer;
WriteUnlockWindows();
// If the mouse cursor is directly over the newly visible window,
@@ -1127,6 +1142,9 @@ Desktop::HideWindow(WindowLayer* window)
SetFocusWindow(FrontWindow());
}
if (dynamic_cast<WorkspacesLayer*>(window->TopLayer()) != NULL)
fWorkspacesLayer = NULL;
WriteUnlockWindows();
}
@@ -1141,6 +1159,7 @@ Desktop::_ShowWindow(WindowLayer* window, bool affectsOtherWindows)
BRegion background;
_RebuildClippingForAllWindows(background);
_SetBackground(background);
_WindowChanged(window);
BRegion dirty(window->VisibleRegion());
@@ -1174,6 +1193,7 @@ Desktop::_HideWindow(WindowLayer* window)
BRegion background;
_RebuildClippingForAllWindows(background);
_SetBackground(background);
_WindowChanged(window);
MarkDirty(dirty);
}
@@ -1216,8 +1236,7 @@ Desktop::MoveWindowBy(WindowLayer* window, float x, float y)
MarkDirty(newDirtyRegion);
_SetBackground(background);
//_WindowsChanged(changed);
_WindowChanged(window);
WriteUnlockWindows();
}
@@ -1244,8 +1263,7 @@ Desktop::ResizeWindowBy(WindowLayer* window, float x, float y)
MarkDirty(newDirtyRegion);
_SetBackground(background);
//_WindowsChanged(changed);
_WindowChanged(window);
WriteUnlockWindows();
}
@@ -1428,11 +1446,10 @@ Desktop::SetWindowLook(WindowLayer *window, window_look newLook)
BRegion stillAvailableOnScreen;
_RebuildClippingForAllWindows(stillAvailableOnScreen);
_SetBackground(stillAvailableOnScreen);
_WindowChanged(window);
_TriggerWindowRedrawing(dirty);
//_WindowsChanged();
WriteUnlockWindows();
}
@@ -1513,10 +1530,10 @@ Desktop::SetWindowFlags(WindowLayer *window, uint32 newFlags)
BRegion stillAvailableOnScreen;
_RebuildClippingForAllWindows(stillAvailableOnScreen);
_SetBackground(stillAvailableOnScreen);
_WindowChanged(window);
_TriggerWindowRedrawing(dirty);
//_WindowsChanged();
WriteUnlockWindows();
}
+4 -1
View File
@@ -44,6 +44,7 @@ class BMessage;
class DrawingEngine;
class HWInterface;
class ServerApp;
class WorkspacesLayer;
namespace BPrivate {
class LinkSender;
@@ -182,6 +183,8 @@ class Desktop : public MessageLooper, public ScreenOwner {
void _UpdateFronts(bool updateFloating = true);
bool _WindowHasModal(WindowLayer* window);
void _WindowChanged(WindowLayer* window);
void _GetLooperName(char* name, size_t size);
void _PrepareQuit();
void _DispatchMessage(int32 code,
@@ -211,8 +214,8 @@ class Desktop : public MessageLooper, public ScreenOwner {
WindowList fAllWindows;
WindowList fSubsetWindows;
WorkspacesLayer* fWorkspacesLayer;
::RootLayer* fRootLayer;
Screen* fActiveScreen;
CursorManager fCursorManager;
+3
View File
@@ -77,6 +77,9 @@ class WindowLayer {
void ScrollViewBy(ViewLayer* view, int32 dx, int32 dy);
void SetTopLayer(ViewLayer* topLayer);
ViewLayer* TopLayer() const { return fTopLayer; }
// TODO: only used for WorkspacesLayer, can go away if we do
// this differently one day
ViewLayer* ViewAt(const BPoint& where);