lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev DISP_PARTIAL fix


From: Leonid Pauzner
Subject: lynx-dev DISP_PARTIAL fix
Date: Tue, 18 Aug 1998 13:15:23 +0400 (MSD)

(Hopefully) the last tweak for DISP_PARTIAL,
to solve the problem of interfering with previously displayed document
under the certain circumstances, see comments in HTDisplayPartial()

It may be desirable to set partial:true by default in lynx.cfg/LYMain.c
I also vote for removing DISP_PARTIAL #ifdef'ing
because this code explicitly controlled by partial_display variable.





diff -u old/htformat.c ./htformat.c
--- old/htformat.c      Thu Aug  6 05:28:22 1998
+++ ./htformat.c        Tue Aug 18 12:30:10 1998
@@ -488,13 +488,23 @@
        **
        **  Update NumOfLines_partial only if we repaint the display,
        **  so it corresponds to real number of displayed lines.
-       **  Repaint the page only if Newline_partial
-       **  in our hand is fact:
+       **  Repaint the page only when necessary:
        */
-       if ((Newline_partial <= HText_getNumOfLines()) &&
-               ((Newline_partial + display_lines) > NumOfLines_partial))  {
+       if ((Newline_partial + display_lines) > NumOfLines_partial) {
+               /* current page not complete... */
+       if ((Newline_partial + 2)  < HText_getNumOfLines()) {
+               /* and we MAY display at least a couple of lines on the top.
+               **
+               ** Note: we check the lines in _rendered_ document
+               ** and real HTML source may have several Kb of headers,
+               ** Javascript applets etc., which are not visible in lynx
+               ** and we got a delay (correct).
+               ** We should NOT try to repaint at that early stage
+               ** to avoid interfere with previously displayed document. - LP
+               */
            NumOfLines_partial = HText_getNumOfLines();
            HText_pageDisplay(Newline_partial, "");
+       }
        }
     }
 }
diff -u old/lyutils.c ./lyutils.c
--- old/lyutils.c       Sat Aug 15 14:57:56 1998
+++ ./lyutils.c Tue Aug 18 12:34:40 1998
@@ -2097,7 +2097,8 @@
     if (TOUPPER(c) == 'Z' || c == 7 || c == 3)
        return((int)TRUE);
 #ifdef DISP_PARTIAL
-    else if (display_partial)
+    else if (display_partial && (NumOfLines_partial > 2))
+    /* OK, we got several lines from new document and want to scroll it... */
     {
        switch (keymap[c+1])
        {
@@ -2132,13 +2133,15 @@
        case LYK_END:
            if (HText_canScrollDown())
                Newline_partial = HText_getNumOfLines() - display_lines + 1;
-               /* set "current" value */
+               /* calculate for "current" bottom value */
            break;
        case LYK_REFRESH :
            break ;
        default :
            return ((int)FALSE) ;
        }
+       if (Newline_partial < 1)
+               Newline_partial = 1;
        NumOfLines_partial = HText_getNumOfLines();
        HText_pageDisplay(Newline_partial, "");
     }



reply via email to

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