Don't look for bugs in other people's code. The bug is in your code. IOW BDirectWindow apps now work fine :)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14848 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2005-11-11 00:45:45 +00:00
parent c5522d81d8
commit df555388b9
2 changed files with 13 additions and 7 deletions

View File

@ -2149,7 +2149,6 @@ ServerWindow::HandleDirectConnection(int bufferState, int driverState)
BRegion exclude = const_cast<BRegion &>(border->VisibleRegion());
clipRegion.Exclude(&exclude);
border->ConvertToScreen(&clipRegion);
fDirectWindowData->direct_info->clip_list_count = min_c(clipRegion.CountRects(), kMaxClipRectsCount);
fDirectWindowData->direct_info->clip_bounds = clipRegion.FrameInt();

View File

@ -187,6 +187,7 @@ WinBorder::MoveBy(float x, float y)
// it's not, as also the mouse movement is driven by rootlayer.
// Find some way to call DirectConnected() from the ServerWindow's thread,
// by sending a message from here or whatever.
// (Tested with BeSnes9x and works fine, though)
Window()->HandleDirectConnection(B_DIRECT_STOP);
if (GetRootLayer()->Lock()) {
@ -246,15 +247,21 @@ WinBorder::ResizeBy(float x, float y)
// this method can be called from a ServerWindow thread or from a RootLayer one,
// so lock
if (GetRootLayer() && GetRootLayer()->Lock()) {
fRebuildDecRegion = true;
if (GetRootLayer()) {
Window()->HandleDirectConnection(B_DIRECT_STOP);
if (GetRootLayer()->Lock()) {
fRebuildDecRegion = true;
if (fDecorator)
fDecorator->ResizeBy(x, y);
if (fDecorator)
fDecorator->ResizeBy(x, y);
Layer::ResizeBy(x, y);
Layer::ResizeBy(x, y);
GetRootLayer()->Unlock();
GetRootLayer()->Unlock();
}
Window()->HandleDirectConnection(B_DIRECT_START|B_BUFFER_RESIZED);
} else {
if (fDecorator)
fDecorator->ResizeBy(x, y);