lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LYNX-DEV Lynx bugs submitted by Debian users.


From: John E. Davis
Subject: Re: LYNX-DEV Lynx bugs submitted by Debian users.
Date: Sun, 18 May 1997 02:55:40 -0400

On Sun, 18 May 1997 00:33:36 -0400, "Christian Hudon"
<address@hidden> said: 
>Basically, lynx doesn't refresh itself when I resize xterm-color. I also
>tried to send a SIGWINCH signal directly to lynx (using kill) and nothing
>happens. I have to hit Ctrl-W to get lynx to repaint the screen. When I hit

Last year when I first added the color support to lynx, I had the
redraw code working properly.  Now, it works but not automatically:
the screen is resized upon the next keysequence.  All SIGWINCH handler
does is to set a global variable to indicate that the terminal has
changed size.  In fact, that is all it should do.  That global
variable is checked only after the readkey routine has returned.  A
patch at the end of this message will force it to return early.

Unfortunately, the lynx `redraw' code logic is rather hard to
decipher, and, in my opinion, should be re-written.  Ideally, the code
should be written in such a way that the screen update is separate
from code to read input characters.  That is, the main loop should
look like:

    while (1)
      {
         void (*f)(void);
         
         update_display ();
         if (NULL != (f = get_input_event ()))
           {
              (*f) ();
           }
      }

Then get_input_event could select on the input descriptor and if
interrupted, it could check the flag set by the SIGWINCH handler and
call update_display directly if necessary.  In LYMainLoop.c, the code
within the `while (TRUE)' loop spans over 4000 lines!

With that said, some of this can be faked if using slang by the
following patch to LYStrings.c.  You will have to perform the patch by
hand.

--- LYStrings.c~        Sat May 17 17:04:56 1997
+++ LYStrings.c Sun May 18 02:27:06 1997
@@ -153,7 +153,7 @@
 #ifdef VMS
 #define GetChar() ttgetc()
 #else
-#define GetChar (int)SLang_getkey
+#define GetChar sl_getkey
 #endif /* VMS */
 #endif /* USE_SLANG */
 
@@ -176,6 +176,21 @@
 #endif /* VMS */
 #endif /* !defined(GetChar) */
 
+
+#if defined(USE_SLANG) && !defined(VMS)
+static int First_Time_Flag;
+PRIVATE int sl_getkey NOARGS
+{
+   while (0 == SLang_input_pending (10000))
+     {
+       if (First_Time_Flag && recent_sizechange)
+         return -1;
+     }
+
+   return SLang_getkey ();
+}
+#endif
+   
 #if defined(NCURSES)
 /*
  * Workaround a bug in ncurses order-of-refresh by setting a pointer to
@@ -247,7 +262,11 @@
     c = GetChar();
 #else
     if (LYCursesON) {
+        First_Time_Flag = 1;
        c = GetChar();
+        First_Time_Flag = 0;
+       if (c == -1)
+        return DO_NOTHING;
     } else {
         c = getchar();
        if (c == EOF && errno == EINTR) /* Ctrl-Z causes EINTR in getchar() */

         
         

     
;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]