From xemacs-m  Sat May 17 18:31:46 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id SAA20353
	for <xemacs-beta@xemacs.org>; Sat, 17 May 1997 18:31:45 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id BAA02513; Sun, 18 May 1997 01:31:44 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: [patch] `no_redraw_on_reenter' has no effect
X-Save-Project-Gutenberg: <URL:http://www.promo.net/pg/nl/pgny_nov96.html>
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 18 May 1997 01:31:43 +0200
Message-ID: <kigpvupy8tc.fsf@jagor.srce.hr>
Lines: 39
X-Mailer: Gnus v5.4.52/XEmacs 20.2

The `no-redraw-on-reenter' variable has no effect in XEmacs.  I don't
know when the bug was introduced, or if it ever did work correctly.

However, some research has shown that the problem is in the fact that
after resuming the console, `suspend-emacs' sets
`asynch_device_change_pending' (since the terminal size might have
changed), which causes the redisplay routines to call
`tty_asynch_device_change', which in turn marks the frame as changed
unconditionally.

The correct fix is for `tty_asynch_device_change' to check whether the 
frame size really changed, and do its magic only in that case.  It
also improves performance when you have several gnuserv-ed TTY
consoles, and resize one of them (but the old gnuclient.c didn't pass
SIGWINCH to Emacs; fixed now.)

I have tested it, and the patch really makes `no-redraw-on-reenter'
work, and doesn't appear to cause unwanted side-effects (e.g. resizing 
works), so I suggest applying it for 20.3.

--- src/device-tty.c.orig	Sun May 18 01:09:55 1997
+++ src/device-tty.c	Sun May 18 01:29:02 1997
@@ -146,7 +146,9 @@
 	continue;
 
       get_tty_device_size (d, &width, &height);
-      if (width > 0 && height > 0)
+      if (width > 0 && height > 0
+	  && (CONSOLE_TTY_DATA (con)->width != width
+	      || CONSOLE_TTY_DATA (con)->height != height))
 	{
 	  CONSOLE_TTY_DATA (con)->width = width;
 	  CONSOLE_TTY_DATA (con)->height = height;


-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
"Psychos _do not_ explode when sunlight hits them."

