Fix changing of the window feel and borderless windows.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42491 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler
2011-07-26 02:41:56 +00:00
parent ed8b50f79a
commit 16aa61c46a
+16 -12
View File
@@ -1213,16 +1213,6 @@ Window::FontsChanged(BRegion* updateRegion)
void
Window::SetLook(window_look look, BRegion* updateRegion)
{
::Decorator* decorator = Decorator();
if (decorator == NULL && look != B_NO_BORDER_WINDOW_LOOK) {
// we need a new decorator
decorator = gDecorManager.AllocateDecorator(this);
if (IsFocus()) {
int32 index = PositionInStack();
decorator->SetFocus(index, true);
}
}
fLook = look;
fContentRegionValid = false;
@@ -1231,6 +1221,20 @@ Window::SetLook(window_look look, BRegion* updateRegion)
// ...and therefor the drawing region is
// likely not valid anymore either
if (fCurrentStack.Get() == NULL)
return;
::Decorator* decorator = Decorator();
if (decorator == NULL && look != B_NO_BORDER_WINDOW_LOOK) {
// we need a new decorator
decorator = gDecorManager.AllocateDecorator(this);
fCurrentStack->SetDecorator(decorator);
if (IsFocus()) {
int32 index = PositionInStack();
decorator->SetFocus(index, true);
}
}
if (decorator != NULL) {
DesktopSettings settings(fDesktop);
decorator->SetLook(settings, look, updateRegion);
@@ -1241,7 +1245,7 @@ Window::SetLook(window_look look, BRegion* updateRegion)
_ObeySizeLimits();
}
if (look == B_NO_BORDER_WINDOW_LOOK && fCurrentStack.Get() != NULL) {
if (look == B_NO_BORDER_WINDOW_LOOK) {
// we don't need a decorator for this window
fCurrentStack->SetDecorator(NULL);
}
@@ -2152,7 +2156,7 @@ Window::StackedWindowAt(const BPoint& where)
{
::Decorator* decorator = Decorator();
if (decorator == NULL)
return NULL;
return this;
int tab = decorator->TabAt(where);
// if we have a decorator we also have a stack