From ef4635a3f9d9cbdce2ddf3e5c125e31e72e8c929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 20 Dec 2005 22:23:48 +0000 Subject: [PATCH] added a few comments git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15623 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Desktop.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index 9a30fcb702..65e6169501 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -1225,6 +1225,7 @@ Desktop::MoveWindowBy(WindowLayer* window, float x, float y) BRegion copyRegion(window->VisibleRegion()); copyRegion.OffsetBy(-x, -y); copyRegion.IntersectWith(&newDirtyRegion); + // newDirtyRegion == the windows old visible region // include the the new visible region of the window being // moved into the dirty region (for now) @@ -1251,7 +1252,11 @@ Desktop::ResizeWindowBy(WindowLayer* window, float x, float y) if (!LockAllWindows()) return; + // the dirty region for the inside of the window is + // constructed by the window itself in ResizeBy() BRegion newDirtyRegion; + // track the dirty region outside the window in case + // it is shrunk in "previouslyOccupiedRegion" BRegion previouslyOccupiedRegion(window->VisibleRegion()); window->ResizeBy(x, y, &newDirtyRegion); @@ -1259,9 +1264,13 @@ Desktop::ResizeWindowBy(WindowLayer* window, float x, float y) BRegion background; _RebuildClippingForAllWindows(background); + // we just care for the region outside the window previouslyOccupiedRegion.Exclude(&window->VisibleRegion()); + // make sure the window cannot mark stuff dirty outside + // its visible region... newDirtyRegion.IntersectWith(&window->VisibleRegion()); + // ...because we do this outself newDirtyRegion.Include(&previouslyOccupiedRegion); MarkDirty(newDirtyRegion);