summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Wong <gtw@gnu.org>2009-08-25 14:19:01 -0600
committerGary Wong <gtw@gnu.org>2009-08-25 14:25:59 -0600
commit1a6891126636505152d134b91e3a3824b3e615b9 (patch)
tree6a376ef20e74cc0d7360d3003e39c1b23982b462
parentef08307763a74c63c87a6888518de127ccfd2c2e (diff)
Properly compute the update region when the old region was empty.
-rw-r--r--ChangeLog5
-rw-r--r--window-table.c33
2 files changed, 26 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 038b015..54053bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-25 Gary Wong <gtw@gnu.org>
+
+ * window-table.c (queue_window_update): Properly compute the
+ update region when the old region was empty.
+
2009-08-24 Gary Wong <gtw@gnu.org>
* gwm.c (shutdown_display) [DEBUG]: Call muntrace() only when
diff --git a/window-table.c b/window-table.c
index 047161e..88ce34f 100644
--- a/window-table.c
+++ b/window-table.c
@@ -243,23 +243,32 @@ extern void queue_window_update( struct gwm_window *window,
int cleared ) {
/* FIXME Consider computing the region instead of the bounding box. */
-
- if( x < window->update.x ) {
- window->update.width += window->update.x - x;
- window->update.x = x;
- }
- if( y < window->update.y ) {
- window->update.height += window->update.y - y;
+ if( !window->update.width || !window->update.height ) {
+ /* New update region. */
+ window->update.x = x;
window->update.y = y;
- }
+ window->update.width = width;
+ window->update.height = height;
+ } else {
+ /* Compute the bounding box of the union of the old and new regions. */
+ if( x < window->update.x ) {
+ window->update.width += window->update.x - x;
+ window->update.x = x;
+ }
- if( x + width > window->update.x + window->update.width )
- window->update.width = x + width - window->update.x;
+ if( y < window->update.y ) {
+ window->update.height += window->update.y - y;
+ window->update.y = y;
+ }
- if( y + height > window->update.y + window->update.height )
- window->update.height = y + height - window->update.y;
+ if( x + width > window->update.x + window->update.width )
+ window->update.width = x + width - window->update.x;
+ if( y + height > window->update.y + window->update.height )
+ window->update.height = y + height - window->update.y;
+ }
+
if( !cleared )
window->cleared = FALSE;