From ebae3c7d614a29283dfdc40089e95cb1cc9ef233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 9 Feb 2006 15:07:56 +0000 Subject: [PATCH] this fixes Chart leaving dirty stars in BDirectWindow mode... at least on my machine. Looks like BDirectWindow resizing is notably smoother on Haiku btw. :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16311 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Desktop.cpp | 19 ++++++++++++++----- src/servers/app/WindowLayer.cpp | 6 +----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index ac1cef4f79..196dab8c3b 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -1274,16 +1275,20 @@ Desktop::MoveWindowBy(WindowLayer* window, float x, float y) if (!LockAllWindows()) return; - // the dirty region starts with the visible area of the window being moved - BRegion newDirtyRegion(window->VisibleRegion()); - - window->MoveBy(x, y); - if (!window->IsVisible()) { + window->MoveBy(x, y); UnlockAllWindows(); return; } + // the dirty region starts with the visible area of the window being moved + BRegion newDirtyRegion(window->VisibleRegion()); + + // no more drawing for DirectWindows + window->ServerWindow()->HandleDirectConnection(B_DIRECT_STOP); + + window->MoveBy(x, y); + BRegion background; _RebuildClippingForAllWindows(background); @@ -1300,6 +1305,10 @@ Desktop::MoveWindowBy(WindowLayer* window, float x, float y) GetDrawingEngine()->CopyRegion(©Region, x, 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(x, y); diff --git a/src/servers/app/WindowLayer.cpp b/src/servers/app/WindowLayer.cpp index ad470d8c92..33d08b0251 100644 --- a/src/servers/app/WindowLayer.cpp +++ b/src/servers/app/WindowLayer.cpp @@ -309,14 +309,10 @@ WindowLayer::MoveBy(int32 x, int32 y) if (x == 0 && y == 0) return; - fWindow->HandleDirectConnection(B_DIRECT_STOP); - fFrame.OffsetBy(x, y); _PropagatePosition(); - fWindow->HandleDirectConnection(B_DIRECT_START | B_BUFFER_MOVED); - - // take along the dirty region which have not + // take along the dirty region which is not // processed yet fDirtyRegion.OffsetBy(x, y);