From xemacs-m  Sun Mar 23 19:38:26 1997
Received: from GS213.SP.CS.CMU.EDU (GS213.SP.CS.CMU.EDU [128.2.209.183])
	by xemacs.org (8.8.5/8.8.5) with SMTP id TAA10206
	for <xemacs-beta@xemacs.org>; Sun, 23 Mar 1997 19:38:26 -0600 (CST)
Received: by GS213.SP.CS.CMU.EDU (AIX 3.2/UCB 5.64/4.03)
          id AA31900; Sun, 23 Mar 1997 20:38:25 -0500
Date: Sun, 23 Mar 1997 20:38:25 -0500
Message-Id: <9703240138.AA31900@GS213.SP.CS.CMU.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Darrell Kindred <dkindred@cmu.edu>
To: xemacs-beta@xemacs.org
Subject: minor patch, flicker problem
Organization: Carnegie Mellon University School of Computer Science
X-Mailer: VM 6.22 under 19.15 XEmacs Lucid (beta103)

There's an off-by-one bug in x_redraw_exposed_window().  It
doesn't cause any serious trouble, but does causes a bit of
unnecessary work.  The patch below should probably be
applied to 20.1 only.

I ran into this while investigating the double-flicker I see
now when switching fvwm pages.  Unfortunately, I concluded
that (as far as I can tell) there isn't much that can be
done about that, unless we want to back out the (b95?)
change that allowed redisplay to be inhibited on off-page
frames. 

The problem is that when you switch to a page containing an
xemacs frame, it gets a VisibilityNotify event, which must
trigger redisplay since the frame wasn't getting updated
while it was hidden.  But then it gets GraphicsExpose events
for the whole frame, which causes it to output everything
again.

I guess one way to take care of this would be to have
change_frame_visibility set some kind of flag that tells
redisplay to update the display data structures but not to
bother doing actual output for the affected frame.  There
doesn't seem to be any such flag at the moment.

- Darrell

--- src/redisplay-x.c.sunday	Sun Mar 23 03:10:34 1997
+++ src/redisplay-x.c	Sun Mar 23 15:53:06 1997
@@ -1810,8 +1810,8 @@
     }
 
   /* If the window doesn't intersect the exposed region, we're done here. */
-  if (x > WINDOW_RIGHT (w) || (x + width) < WINDOW_LEFT (w)
-      || y > WINDOW_BOTTOM (w) || (y + height) < WINDOW_TOP (w))
+  if (x >= WINDOW_RIGHT (w) || (x + width) <= WINDOW_LEFT (w)
+      || y >= WINDOW_BOTTOM (w) || (y + height) <= WINDOW_TOP (w))
     {
       return;
     }

