From f98bacf6ca52679ea11700bf43681391c17612cf Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Thu, 13 Aug 2009 14:01:25 +0000 Subject: [PATCH] Moved HandleDirectConnection From Window to Desktop. This should fix the spurious off-window drawing of BDirectWindow. At least, it does here. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32312 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Desktop.cpp | 16 ++++++++++------ src/servers/app/Window.cpp | 4 ---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index bb9ee8044d..73cda3b367 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -1912,6 +1912,8 @@ Desktop::_ShowWindow(Window* window, bool affectsOtherWindows) void Desktop::_HideWindow(Window* window) { + window->ServerWindow()->HandleDirectConnection(B_DIRECT_STOP); + // after rebuilding the clipping, // this window will not have a visible // region anymore, so we need to remember @@ -1927,8 +1929,6 @@ Desktop::_HideWindow(Window* window) _WindowChanged(window); MarkDirty(dirty); - - window->ServerWindow()->HandleDirectConnection(B_DIRECT_STOP); } @@ -1981,10 +1981,6 @@ Desktop::MoveWindowBy(Window* window, float x, float y, int32 workspace) GetDrawingEngine()->CopyRegion(©Region, (int32)x, (int32)y); - // allow DirectWindows to draw again after the visual - // content is at the new location - window->ServerWindow()->HandleDirectConnection(B_DIRECT_START | B_BUFFER_MOVED); - // in the dirty region, exclude the parts that we // could move by blitting copyRegion.OffsetBy((int32)x, (int32)y); @@ -1994,6 +1990,10 @@ Desktop::MoveWindowBy(Window* window, float x, float y, int32 workspace) _SetBackground(background); _WindowChanged(window); + // allow DirectWindows to draw again after the visual + // content is at the new location + window->ServerWindow()->HandleDirectConnection(B_DIRECT_START | B_BUFFER_MOVED); + UnlockAllWindows(); } @@ -2017,6 +2017,8 @@ Desktop::ResizeWindowBy(Window* window, float x, float y) // it is shrunk in "previouslyOccupiedRegion" BRegion previouslyOccupiedRegion(window->VisibleRegion()); + window->ServerWindow()->HandleDirectConnection(B_DIRECT_STOP); + window->ResizeBy((int32)x, (int32)y, &newDirtyRegion); BRegion background; @@ -2035,6 +2037,8 @@ Desktop::ResizeWindowBy(Window* window, float x, float y) _SetBackground(background); _WindowChanged(window); + window->ServerWindow()->HandleDirectConnection(B_DIRECT_START | B_BUFFER_RESIZED); + UnlockAllWindows(); } diff --git a/src/servers/app/Window.cpp b/src/servers/app/Window.cpp index 5543fe7775..89b9fa3032 100644 --- a/src/servers/app/Window.cpp +++ b/src/servers/app/Window.cpp @@ -365,13 +365,9 @@ Window::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion) if (x == 0 && y == 0) return; - fWindow->HandleDirectConnection(B_DIRECT_STOP); - fFrame.right += x; fFrame.bottom += y; - fWindow->HandleDirectConnection(B_DIRECT_START | B_BUFFER_RESIZED); - fBorderRegionValid = false; fContentRegionValid = false; fEffectiveDrawingRegionValid = false;