* Moved change_winBorder_feel() into GoChangeWinBorderFeel() and removed the former.

* Renamed GoChangeWinBorderFeel() to ChangeWinBorderFeel().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15114 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-11-24 13:26:26 +00:00
parent bde8b9c6e0
commit 5d29bfa5fa
3 changed files with 46 additions and 55 deletions

View File

@ -147,15 +147,6 @@ RootLayer::~RootLayer()
}
void
RootLayer::GoChangeWinBorderFeel(WinBorder *winBorder, int32 newFeel)
{
Lock();
change_winBorder_feel(winBorder, newFeel);
Unlock();
}
void
RootLayer::MoveBy(float x, float y)
{
@ -664,6 +655,50 @@ RootLayer::ShowWinBorder(WinBorder* winBorder)
}
void
RootLayer::ChangeWinBorderFeel(WinBorder *winBorder, int32 newFeel)
{
BAutolock _(fAllRegionsLock);
bool isVisible = false;
bool isVisibleInActiveWorkspace = false;
Workspace::State oldWMState;
ActiveWorkspace()->GetState(&oldWMState);
if (!winBorder->IsHidden()) {
isVisible = true;
isVisibleInActiveWorkspace = ActiveWorkspace()->HasWinBorder(winBorder);
// just hide, don't invalidate
winBorder->Hide(false);
// all workspaces must be up-to-date with this change of feel.
for (int32 i = 0; i < kMaxWorkspaceCount; i++) {
if (fWorkspace[i]) {
fWorkspace[i]->HideWinBorder(winBorder);
fWorkspace[i]->RemoveWinBorder(winBorder);
}
}
}
fDesktop->SetWinBorderFeel(winBorder, newFeel);
if (isVisible) {
// just show, don't invalidate
winBorder->Show(false);
// all workspaces must be up-to-date with this change of feel.
for (int32 i = 0; i < kMaxWorkspaceCount; i++) {
if (fWorkspace[i]) {
fWorkspace[i]->AddWinBorder(winBorder);
fWorkspace[i]->ShowWinBorder(winBorder);
}
}
if (isVisibleInActiveWorkspace)
RevealNewWMState(oldWMState);
}
}
void
RootLayer::RevealNewWMState(Workspace::State &oldWMState)
{
@ -953,48 +988,6 @@ RootLayer::DragMessage(void) const
// PRIVATE methods
void
RootLayer::change_winBorder_feel(WinBorder *winBorder, int32 newFeel)
{
bool isVisible = false;
bool isVisibleInActiveWorkspace = false;
Workspace::State oldWMState;
ActiveWorkspace()->GetState(&oldWMState);
if (!winBorder->IsHidden()) {
isVisible = true;
isVisibleInActiveWorkspace = ActiveWorkspace()->HasWinBorder(winBorder);
// just hide, don't invalidate
winBorder->Hide(false);
// all workspaces must be up-to-date with this change of feel.
for (int32 i = 0; i < kMaxWorkspaceCount; i++) {
if (fWorkspace[i]) {
fWorkspace[i]->HideWinBorder(winBorder);
fWorkspace[i]->RemoveWinBorder(winBorder);
}
}
}
fDesktop->SetWinBorderFeel(winBorder, newFeel);
if (isVisible) {
// just show, don't invalidate
winBorder->Show(false);
// all workspaces must be up-to-date with this change of feel.
for (int32 i = 0; i < kMaxWorkspaceCount; i++) {
if (fWorkspace[i]) {
fWorkspace[i]->AddWinBorder(winBorder);
fWorkspace[i]->ShowWinBorder(winBorder);
}
}
if (isVisibleInActiveWorkspace)
RevealNewWMState(oldWMState);
}
}
void
RootLayer::Draw(const BRect &r)
{

View File

@ -103,7 +103,7 @@ public:
void Unlock() { fAllRegionsLock.Unlock(); }
bool IsLocked() { return fAllRegionsLock.IsLocked(); }
void GoChangeWinBorderFeel(WinBorder *winBorder, int32 newFeel);
void ChangeWinBorderFeel(WinBorder *winBorder, int32 newFeel);
void MarkForRedraw(const BRegion &dirty);
void TriggerRedraw();
@ -121,8 +121,6 @@ friend class Desktop;
void AddSubsetWinBorder(WinBorder *winBorder, WinBorder *toWinBorder);
void RemoveSubsetWinBorder(WinBorder *winBorder, WinBorder *fromWinBorder);
void change_winBorder_feel(WinBorder *winBorder, int32 newFeel);
void MouseEventHandler(BMessage *msg);
Layer* _ChildAt(BPoint where);

View File

@ -1364,7 +1364,7 @@ if (rootLayer)
int32 newFeel;
link.Read<int32>(&newFeel);
fWinBorder->GetRootLayer()->GoChangeWinBorderFeel(winBorder, newFeel);
fWinBorder->GetRootLayer()->ChangeWinBorderFeel(winBorder, newFeel);
break;
}
case AS_SET_ALIGNMENT: