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);