commit 9be0332389a3c475bd75aec2707847b6177b2fdf
parent a2075488d9e8ac704489107771e11c7130581ea3
Author: ukai <ukai>
Date:   Tue, 25 Dec 2001 09:08:58 +0000
[w3m-dev 02719]
From: Fumitoshi UKAI  <ukai@debian.or.jp>
Diffstat:
2 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,10 @@
+2001-12-25  Fumitoshi UKAI  <ukai@debian.or.jp>
+
+	* [w3m-dev 02719] (based on [w3m-dev 02708] comments)
+	* resize_hook: set resized flag only
+	* main.c (MAIN): in key input loop, process resize 
+		when resized flag is set
+
 2001-12-24  Fumitoshi UKAI  <ukai@debian.or.jp>
 
 	* [w3m-dev 02702] fix problem with emacs-w3m in [w3m-dev 02699]
diff --git a/main.c b/main.c
@@ -45,6 +45,10 @@ static Event alarm_event;
 static MySignalHandler SigAlarm(SIGNAL_ARG);
 #endif
 
+#ifdef SIGWINCH
+static int resized = 0;
+#endif
+
 #ifdef USE_MARK
 static char *MarkString = NULL;
 #endif
@@ -896,9 +900,7 @@ MAIN(int argc, char **argv, char **envp)
     setlinescols();
     setupscreen();
 #endif				/* not SIGWINCH */
-#ifdef SIGCHLD
-    signal(SIGCHLD, sig_chld);
-#endif
+
     Currentbuf = Firstbuf;
     displayBuffer(Currentbuf, B_NORMAL);
     if (line_str) {
@@ -938,6 +940,15 @@ MAIN(int argc, char **argv, char **envp)
 	    alarm(alarm_sec);
 	}
 #endif
+#ifdef SIGWINCH
+	if (resized) {
+	    resized = 0;
+	    setlinescols();
+	    setupscreen();
+	    if (Currentbuf)
+		displayBuffer(Currentbuf, B_FORCE_REDRAW);
+	}
+#endif
 	c = getch();
 #ifdef USE_ALARM
 	if (alarm_sec > 0) {
@@ -1166,10 +1177,7 @@ intTrap(SIGNAL_ARG)
 MySignalHandler
 resize_hook(SIGNAL_ARG)
 {
-    setlinescols();
-    setupscreen();
-    if (Currentbuf)
-	displayBuffer(Currentbuf, B_FORCE_REDRAW);
+    resized = 1;
     signal(SIGWINCH, resize_hook);
     SIGNAL_RETURN;
 }