From df555388b940f0a25cbd5f6dcb5b19ac4183ccd6 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Fri, 11 Nov 2005 00:45:45 +0000 Subject: [PATCH] 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 --- src/servers/app/ServerWindow.cpp | 1 - src/servers/app/WinBorder.cpp | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index b6c990e227..1b3b69d918 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -2149,7 +2149,6 @@ ServerWindow::HandleDirectConnection(int bufferState, int driverState) BRegion exclude = const_cast(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(); diff --git a/src/servers/app/WinBorder.cpp b/src/servers/app/WinBorder.cpp index 7d2e6c3b84..777493cd19 100644 --- a/src/servers/app/WinBorder.cpp +++ b/src/servers/app/WinBorder.cpp @@ -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);