From dea7a63c17f28bfc1038c9d26d42bdb7eeb666b7 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 11 Oct 2005 22:32:27 +0000 Subject: [PATCH] Some changes in _HandleDirectConnection(). Not tested. Could even fix the relative crashing bug. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14358 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/ServerWindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index 9ef5eb8682..ecd7519b2f 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -2400,15 +2400,15 @@ ServerWindow::_HandleDirectConnection(direct_buffer_state state) fDirectWindowData->direct_info->layout = B_BUFFER_NONINTERLEAVED; fDirectWindowData->direct_info->orientation = B_BUFFER_TOP_TO_BOTTOM; // TODO - const WinBorder *border = GetWinBorder(); - fDirectWindowData->direct_info->window_bounds = to_clipping_rect(border->Bounds()); + WinBorder *border = const_cast(GetWinBorder()); + fDirectWindowData->direct_info->window_bounds = to_clipping_rect(border->Frame()); // TODO: Review this const int32 kMaxClipRectsCount = (B_PAGE_SIZE - sizeof(direct_buffer_info)) / sizeof(clipping_rect); - // const_cast<> is needed because BRegion::CountRects() isn't const. Bah. // TODO: Is this the correct region to take into account ? - BRegion &clipRegion = const_cast(border->VisibleRegion()); + BRegion clipRegion = const_cast(border->VisibleRegion()); + border->ConvertToTop(&clipRegion); fDirectWindowData->direct_info->clip_list_count = min_c(clipRegion.CountRects(), kMaxClipRectsCount); fDirectWindowData->direct_info->clip_bounds = clipRegion.FrameInt();