Fixes #7796. The decorator add-on is unloaded when not needed anymore. Avoid assigning offscreen windows a window behaviour (which lives in an add-on). When loading another add-on the offscreen window was still pointing to an invalid window behaviour.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42482 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler 2011-07-25 03:32:14 +00:00
parent ac9cbf2906
commit 418f391fb1
3 changed files with 10 additions and 4 deletions

View File

@ -20,6 +20,7 @@ const window_feel kDesktopWindowFeel = window_feel(1024);
const window_feel kMenuWindowFeel = window_feel(1025);
const window_feel kWindowScreenFeel = window_feel(1026);
const window_feel kPasswordWindowFeel = window_feel(1027);
const window_feel kOffscreenWindowFeel = window_feel(1028);
/* Private window types */

View File

@ -14,6 +14,8 @@
#include <Debug.h>
#include <WindowPrivate.h>
#include "BitmapHWInterface.h"
#include "DrawingEngine.h"
#include "ServerBitmap.h"
@ -24,7 +26,7 @@ using std::nothrow;
OffscreenWindow::OffscreenWindow(ServerBitmap* bitmap,
const char* name, ::ServerWindow* window)
: Window(bitmap->Bounds(), name,
B_NO_BORDER_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
B_NO_BORDER_WINDOW_LOOK, kOffscreenWindowFeel,
0, 0, window, new (nothrow) DrawingEngine()),
fBitmap(bitmap),
fHWInterface(new (nothrow) BitmapHWInterface(fBitmap))

View File

@ -137,7 +137,8 @@ Window::Window(const BRect& frame, const char *name,
&fMaxHeight);
}
}
fWindowBehaviour = gDecorManager.AllocateWindowBehaviour(this);
if (fFeel != kOffscreenWindowFeel)
fWindowBehaviour = gDecorManager.AllocateWindowBehaviour(this);
// do we need to change our size to let the decorator fit?
// _ResizeBy() will adapt the frame for validity before resizing
@ -183,7 +184,8 @@ Window::~Window()
status_t
Window::InitCheck() const
{
if (!fDrawingEngine || !fWindowBehaviour)
if (fDrawingEngine == NULL
|| (fFeel != kOffscreenWindowFeel && fWindowBehaviour == NULL))
return B_NO_MEMORY;
// TODO: anything else?
return B_OK;
@ -1597,7 +1599,8 @@ Window::IsValidFeel(window_feel feel)
|| feel == kDesktopWindowFeel
|| feel == kMenuWindowFeel
|| feel == kWindowScreenFeel
|| feel == kPasswordWindowFeel;
|| feel == kPasswordWindowFeel
|| feel == kOffscreenWindowFeel;
}