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:
+29
-12
@@ -24,6 +24,7 @@
|
|||||||
#include "ServerWindow.h"
|
#include "ServerWindow.h"
|
||||||
#include "WindowLayer.h"
|
#include "WindowLayer.h"
|
||||||
#include "Workspace.h"
|
#include "Workspace.h"
|
||||||
|
#include "WorkspacesLayer.h"
|
||||||
|
|
||||||
#include <WindowInfo.h>
|
#include <WindowInfo.h>
|
||||||
#include <ServerProtocol.h>
|
#include <ServerProtocol.h>
|
||||||
@@ -259,6 +260,7 @@ Desktop::Desktop(uid_t userID)
|
|||||||
fShutdownSemaphore(-1),
|
fShutdownSemaphore(-1),
|
||||||
fAllWindows(kAllWindowList),
|
fAllWindows(kAllWindowList),
|
||||||
fSubsetWindows(kSubsetList),
|
fSubsetWindows(kSubsetList),
|
||||||
|
fWorkspacesLayer(NULL),
|
||||||
fActiveScreen(NULL),
|
fActiveScreen(NULL),
|
||||||
fWindowLock("window lock")
|
fWindowLock("window lock")
|
||||||
{
|
{
|
||||||
@@ -563,11 +565,7 @@ Desktop::UpdateWorkspaces()
|
|||||||
{
|
{
|
||||||
// TODO: maybe this should be replaced by a SetWorkspacesCount() method
|
// TODO: maybe this should be replaced by a SetWorkspacesCount() method
|
||||||
|
|
||||||
/* if (fWorkspacesLayer == NULL)
|
_WindowChanged(NULL);
|
||||||
return;
|
|
||||||
|
|
||||||
_WindowsChanged();
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -680,6 +678,8 @@ Desktop::SetWorkspace(int32 index)
|
|||||||
if (!_Windows(index).HasWindow(FocusWindow()) || !FocusWindow()->IsFloating())
|
if (!_Windows(index).HasWindow(FocusWindow()) || !FocusWindow()->IsFloating())
|
||||||
SetFocusWindow(FrontWindow());
|
SetFocusWindow(FrontWindow());
|
||||||
|
|
||||||
|
_WindowChanged(NULL);
|
||||||
|
|
||||||
MarkDirty(dirty);
|
MarkDirty(dirty);
|
||||||
|
|
||||||
//_WindowsChanged();
|
//_WindowsChanged();
|
||||||
@@ -867,6 +867,16 @@ Desktop::_WindowHasModal(WindowLayer* window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Desktop::_WindowChanged(WindowLayer* window)
|
||||||
|
{
|
||||||
|
if (fWorkspacesLayer == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
fWorkspacesLayer->WindowChanged(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Desktop::SetFocusWindow(WindowLayer* focus)
|
Desktop::SetFocusWindow(WindowLayer* focus)
|
||||||
{
|
{
|
||||||
@@ -929,6 +939,8 @@ Desktop::_BringWindowsToFront(WindowList& windows, int32 list,
|
|||||||
_CurrentWindows().AddWindow(window,
|
_CurrentWindows().AddWindow(window,
|
||||||
window->Frontmost(_CurrentWindows().FirstWindow(),
|
window->Frontmost(_CurrentWindows().FirstWindow(),
|
||||||
fCurrentWorkspace));
|
fCurrentWorkspace));
|
||||||
|
|
||||||
|
_WindowChanged(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
BRegion dummy;
|
BRegion dummy;
|
||||||
@@ -1081,6 +1093,9 @@ Desktop::ShowWindow(WindowLayer* window)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (WorkspacesLayer* layer = dynamic_cast<WorkspacesLayer*>(window->TopLayer()))
|
||||||
|
fWorkspacesLayer = layer;
|
||||||
|
|
||||||
WriteUnlockWindows();
|
WriteUnlockWindows();
|
||||||
|
|
||||||
// If the mouse cursor is directly over the newly visible window,
|
// If the mouse cursor is directly over the newly visible window,
|
||||||
@@ -1127,6 +1142,9 @@ Desktop::HideWindow(WindowLayer* window)
|
|||||||
SetFocusWindow(FrontWindow());
|
SetFocusWindow(FrontWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dynamic_cast<WorkspacesLayer*>(window->TopLayer()) != NULL)
|
||||||
|
fWorkspacesLayer = NULL;
|
||||||
|
|
||||||
WriteUnlockWindows();
|
WriteUnlockWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1141,6 +1159,7 @@ Desktop::_ShowWindow(WindowLayer* window, bool affectsOtherWindows)
|
|||||||
BRegion background;
|
BRegion background;
|
||||||
_RebuildClippingForAllWindows(background);
|
_RebuildClippingForAllWindows(background);
|
||||||
_SetBackground(background);
|
_SetBackground(background);
|
||||||
|
_WindowChanged(window);
|
||||||
|
|
||||||
BRegion dirty(window->VisibleRegion());
|
BRegion dirty(window->VisibleRegion());
|
||||||
|
|
||||||
@@ -1174,6 +1193,7 @@ Desktop::_HideWindow(WindowLayer* window)
|
|||||||
BRegion background;
|
BRegion background;
|
||||||
_RebuildClippingForAllWindows(background);
|
_RebuildClippingForAllWindows(background);
|
||||||
_SetBackground(background);
|
_SetBackground(background);
|
||||||
|
_WindowChanged(window);
|
||||||
|
|
||||||
MarkDirty(dirty);
|
MarkDirty(dirty);
|
||||||
}
|
}
|
||||||
@@ -1216,8 +1236,7 @@ Desktop::MoveWindowBy(WindowLayer* window, float x, float y)
|
|||||||
|
|
||||||
MarkDirty(newDirtyRegion);
|
MarkDirty(newDirtyRegion);
|
||||||
_SetBackground(background);
|
_SetBackground(background);
|
||||||
|
_WindowChanged(window);
|
||||||
//_WindowsChanged(changed);
|
|
||||||
|
|
||||||
WriteUnlockWindows();
|
WriteUnlockWindows();
|
||||||
}
|
}
|
||||||
@@ -1244,8 +1263,7 @@ Desktop::ResizeWindowBy(WindowLayer* window, float x, float y)
|
|||||||
|
|
||||||
MarkDirty(newDirtyRegion);
|
MarkDirty(newDirtyRegion);
|
||||||
_SetBackground(background);
|
_SetBackground(background);
|
||||||
|
_WindowChanged(window);
|
||||||
//_WindowsChanged(changed);
|
|
||||||
|
|
||||||
WriteUnlockWindows();
|
WriteUnlockWindows();
|
||||||
}
|
}
|
||||||
@@ -1428,11 +1446,10 @@ Desktop::SetWindowLook(WindowLayer *window, window_look newLook)
|
|||||||
BRegion stillAvailableOnScreen;
|
BRegion stillAvailableOnScreen;
|
||||||
_RebuildClippingForAllWindows(stillAvailableOnScreen);
|
_RebuildClippingForAllWindows(stillAvailableOnScreen);
|
||||||
_SetBackground(stillAvailableOnScreen);
|
_SetBackground(stillAvailableOnScreen);
|
||||||
|
_WindowChanged(window);
|
||||||
|
|
||||||
_TriggerWindowRedrawing(dirty);
|
_TriggerWindowRedrawing(dirty);
|
||||||
|
|
||||||
//_WindowsChanged();
|
|
||||||
|
|
||||||
WriteUnlockWindows();
|
WriteUnlockWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1513,10 +1530,10 @@ Desktop::SetWindowFlags(WindowLayer *window, uint32 newFlags)
|
|||||||
BRegion stillAvailableOnScreen;
|
BRegion stillAvailableOnScreen;
|
||||||
_RebuildClippingForAllWindows(stillAvailableOnScreen);
|
_RebuildClippingForAllWindows(stillAvailableOnScreen);
|
||||||
_SetBackground(stillAvailableOnScreen);
|
_SetBackground(stillAvailableOnScreen);
|
||||||
|
_WindowChanged(window);
|
||||||
|
|
||||||
_TriggerWindowRedrawing(dirty);
|
_TriggerWindowRedrawing(dirty);
|
||||||
|
|
||||||
//_WindowsChanged();
|
|
||||||
|
|
||||||
WriteUnlockWindows();
|
WriteUnlockWindows();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class BMessage;
|
|||||||
class DrawingEngine;
|
class DrawingEngine;
|
||||||
class HWInterface;
|
class HWInterface;
|
||||||
class ServerApp;
|
class ServerApp;
|
||||||
|
class WorkspacesLayer;
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
class LinkSender;
|
class LinkSender;
|
||||||
@@ -182,6 +183,8 @@ class Desktop : public MessageLooper, public ScreenOwner {
|
|||||||
void _UpdateFronts(bool updateFloating = true);
|
void _UpdateFronts(bool updateFloating = true);
|
||||||
bool _WindowHasModal(WindowLayer* window);
|
bool _WindowHasModal(WindowLayer* window);
|
||||||
|
|
||||||
|
void _WindowChanged(WindowLayer* window);
|
||||||
|
|
||||||
void _GetLooperName(char* name, size_t size);
|
void _GetLooperName(char* name, size_t size);
|
||||||
void _PrepareQuit();
|
void _PrepareQuit();
|
||||||
void _DispatchMessage(int32 code,
|
void _DispatchMessage(int32 code,
|
||||||
@@ -211,8 +214,8 @@ class Desktop : public MessageLooper, public ScreenOwner {
|
|||||||
|
|
||||||
WindowList fAllWindows;
|
WindowList fAllWindows;
|
||||||
WindowList fSubsetWindows;
|
WindowList fSubsetWindows;
|
||||||
|
WorkspacesLayer* fWorkspacesLayer;
|
||||||
|
|
||||||
::RootLayer* fRootLayer;
|
|
||||||
Screen* fActiveScreen;
|
Screen* fActiveScreen;
|
||||||
|
|
||||||
CursorManager fCursorManager;
|
CursorManager fCursorManager;
|
||||||
|
|||||||
@@ -77,6 +77,9 @@ class WindowLayer {
|
|||||||
void ScrollViewBy(ViewLayer* view, int32 dx, int32 dy);
|
void ScrollViewBy(ViewLayer* view, int32 dx, int32 dy);
|
||||||
|
|
||||||
void SetTopLayer(ViewLayer* topLayer);
|
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);
|
ViewLayer* ViewAt(const BPoint& where);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user