Watch the window look and remove a window from a S&T group if the look changed to B_NO_BORDER_WINDOW_LOOK.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38731 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler 2010-09-19 21:46:42 +00:00
parent 3ae8f84c3d
commit 7306ba0448
5 changed files with 43 additions and 4 deletions

View File

@ -281,7 +281,7 @@ StackAndTile::WindowMinimized(Window* window, bool minimize)
void
StackAndTile::WindowTabLocationChanged(Window* window, float location)
{
SATWindow* satWindow = GetSATWindow(window);
SATWindow* satWindow = GetSATWindow(window);
if (!satWindow)
return;
@ -294,7 +294,7 @@ void
StackAndTile::SizeLimitsChanged(Window* window, int32 minWidth, int32 maxWidth,
int32 minHeight, int32 maxHeight)
{
SATWindow* satWindow = GetSATWindow(window);
SATWindow* satWindow = GetSATWindow(window);
if (!satWindow)
return;
WindowArea* area = satWindow->GetWindowArea();
@ -304,10 +304,27 @@ StackAndTile::SizeLimitsChanged(Window* window, int32 minWidth, int32 maxWidth,
}
void
StackAndTile::WindowLookChanged(Window* window, window_look look)
{
// if the decorator has been removed remove it from the stacking group
if (look != B_NO_BORDER_WINDOW_LOOK)
return;
SATWindow* satWindow = GetSATWindow(window);
if (!satWindow)
return;
SATGroup* group = satWindow->GetGroup();
if (!group)
return;
group->RemoveWindow(satWindow);
}
bool
StackAndTile::SetDecoratorSettings(Window* window, const BMessage& settings)
{
SATWindow* satWindow = GetSATWindow(window);
SATWindow* satWindow = GetSATWindow(window);
if (!satWindow)
return false;
@ -319,7 +336,7 @@ StackAndTile::SetDecoratorSettings(Window* window, const BMessage& settings)
void
StackAndTile::GetDecoratorSettings(Window* window, BMessage& settings)
{
SATWindow* satWindow = GetSATWindow(window);
SATWindow* satWindow = GetSATWindow(window);
if (!satWindow)
return;

View File

@ -76,6 +76,8 @@ public:
virtual void SizeLimitsChanged(Window* window,
int32 minWidth, int32 maxWidth,
int32 minHeight, int32 maxHeight);
virtual void WindowLookChanged(Window* window,
window_look look);
virtual bool SetDecoratorSettings(Window* window,
const BMessage& settings);

View File

@ -1491,6 +1491,8 @@ Desktop::SetWindowLook(Window* window, window_look newLook)
// finds out it needs to resize itself...
RebuildAndRedrawAfterWindowChange(window, dirty);
NotifyWindowLookChanged(window, newLook);
}

View File

@ -267,6 +267,19 @@ DesktopObservable::NotifySizeLimitsChanged(Window* window, int32 minWidth,
}
void
DesktopObservable::NotifyWindowLookChanged(Window* window, window_look look)
{
if (fWeAreInvoking)
return;
InvokeGuard invokeGuard(fWeAreInvoking);
for (DesktopListener* listener = fDesktopListenerList.First();
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
listener->WindowLookChanged(window, look);
}
bool
DesktopObservable::SetDecoratorSettings(Window* window,
const BMessage& settings)

View File

@ -14,6 +14,7 @@
#include <Point.h>
#include <ServerLink.h>
#include "Window.h"
class BMessage;
@ -61,6 +62,8 @@ public:
virtual void SizeLimitsChanged(Window* window,
int32 minWidth, int32 maxWidth,
int32 minHeight, int32 maxHeight) = 0;
virtual void WindowLookChanged(Window* window,
window_look look) = 0;
virtual bool SetDecoratorSettings(Window* window,
const BMessage& settings) = 0;
@ -112,6 +115,8 @@ public:
void NotifySizeLimitsChanged(Window* window,
int32 minWidth, int32 maxWidth,
int32 minHeight, int32 maxHeight);
void NotifyWindowLookChanged(Window* window,
window_look look);
bool SetDecoratorSettings(Window* window,
const BMessage& settings);