Author: czeidler Date: 2011-07-26 04:41:56 +0200 (Tue, 26 Jul 2011) New Revision: 42491 Changeset: https://dev.haiku-os.org/changeset/42491 Modified: haiku/trunk/src/servers/app/Window.cpp Log: Fix changing of the window feel and borderless windows. Modified: haiku/trunk/src/servers/app/Window.cpp =================================================================== --- haiku/trunk/src/servers/app/Window.cpp 2011-07-25 22:52:00 UTC (rev 42490) +++ haiku/trunk/src/servers/app/Window.cpp 2011-07-26 02:41:56 UTC (rev 42491) @@ -1213,24 +1213,28 @@ void Window::SetLook(window_look look, BRegion* updateRegion) { + fLook = look; + + fContentRegionValid = false; + // mabye a resize handle was added... + fEffectiveDrawingRegionValid = false; + // ...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); } } - fLook = look; - - fContentRegionValid = false; - // mabye a resize handle was added... - fEffectiveDrawingRegionValid = false; - // ...and therefor the drawing region is - // likely not valid anymore either - if (decorator != NULL) { DesktopSettings settings(fDesktop); decorator->SetLook(settings, look, updateRegion); @@ -1241,7 +1245,7 @@ _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 @@ { ::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