lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev Keystrokes with DISP_PARTIAL


From: Leonid Pauzner
Subject: Re: lynx-dev Keystrokes with DISP_PARTIAL
Date: Tue, 25 Aug 1998 02:02:10 +0400 (MSD)

>      * From: Roger Hill <address@hidden>
>      * Date: Sun, 23 Aug 1998 17:52:54 -0400 (BST)
>      * In-Reply-To: <address@hidden>
>      * Reply-To: address@hidden
>      * Sender: address@hidden
>      _________________________________________________________________
>
> On Sun, 23 Aug 1998, Doug Kaufman wrote:
>
> > I noticed that with the DISP_PARTIAL code active you can go backward or
> > forward in the display, but other keystrokes seem to be discarded.
> >
> > I also noted that when I start at my bookmark page (via WWW_HOME), it
> > loads twice in succession. I hadn't noted that before. All actions
> > described are with lynx2.8.1dev.22 on SunOS 4.1.3_U1.
> >                                   Doug
> I have noticed both of these behaviours too; the double loading of the
> bookmark page is quite annoying.
>
First question is described in LYUtils.c (LYHTInterrupt() or smth like this).
The only thing that was changed in dev22 was to restrict scrolling
when HTTP request sent, but no new page displayed on the screen yet.
Other keystrokes was not affected - they were disabled in all previous versions.
or not?

The second is the bug (if I understand you right).
I found the problem with disp_partial mode, look:
we have an HTTP stream and it goes to SGML/HTML parser,
these two stage asynchronous, the second occurs with unknown delay,
but we call redisplay page from the first stage and the second stage
is the target (so we may got previous doc if we call too fast).

I made the patch and sent it to Tom Dickey yesterday morning
but seems it was postponed for next week.
Try to apply it and write if you have any problem.
(if you use EXP_FORMS_OPTIONS insert LYpop() on the bottom of postoptions()
just before it returns NULLFILE, because my patch also affect it).

> * Reduce clutter in mainloop by inserting LYpop() in postoptions() - LP
> * The last fix for DISP_PARTIAL: HTDisplayPartial() now synchronized
> against HText_new() which create the new HTMainText object. Otherwise
> HTDisplayPartial() simetimes was matching old HTMainText (with its
> own line counter) and repaint previous doc, not a new one. - LP
>
>
>
> see also trace log of the problem:
>
> StreamStack: found exact match: text/html
> GridText: HText_pageDisplay at line 1
>           ^^^^^^^^^^^^^^^^^before HText_new
> SGML: Start <HTML>
> GridText: HText_new started
> GridText: Change to style Normal
> GridText: split_line called
> HTML:begin_element[0]: adding style to stack - Normal
> SGML: Start <HEAD>
> HTML:begin_element[1]: adding style to stack - Normal
> SGML: Start <TITLE>
> HTML:begin_element[2]: adding style to stack - Normal
> SGML: End </TITLE>
>
>
>

diff -u old/gridtext.c ./gridtext.c
--- old/gridtext.c      Fri Aug 21 06:30:14 1998
+++ ./gridtext.c        Sun Aug 23 02:06:30 1998
@@ -525,6 +525,17 @@
     underline_on = FALSE; /* reset */
     bold_on = FALSE;

+#ifdef DISP_PARTIAL
+    /*
+     * By this function we create HText object and set new Lines counter
+     * so we may start display the document while downloading. - LP
+     */
+    if (display_partial)
+         NumOfLines_partial = 0;  /* enable HTDisplayPartial() */
+#endif
+
+    CTRACE(tfp, "GridText: start HText_new\n");
+
     return self;
 }

@@ -3971,6 +3982,8 @@
        int,            line_num,
        char *,         target)
 {
+    CTRACE(tfp, "GridText: HText_pageDisplay at line %d started\n", line_num);
+
     display_page(HTMainText, line_num-1, target);

     is_www_index = HTAnchor_isIndex(HTMainAnchor);
diff -u old/htformat.c ./htformat.c
--- old/htformat.c      Fri Aug 21 06:30:14 1998
+++ ./htformat.c        Sun Aug 23 02:10:24 1998
@@ -486,24 +486,30 @@
        **  HText_getNumOfLines() = "current" number of lines received
        **  NumOfLines_partial = number of lines at the moment of last repaint.
        **
-       **  Update NumOfLines_partial only if we repaint the display,
-       **  so it corresponds to real number of displayed lines.
-       **  Repaint the page only when necessary:
+       **  We update NumOfLines_partial only when we repaint the display.
+       **  -1 is the special value:
+       **  This is a synchronization flag switched to 0 when HText_new()
+       **  start new HTMainText object - all hypertext functions use it,
+       **  lines counter in particular [we call it from HText_getNumOfLines()].
+       **
+       **  Otherwise HTMainText hold info from the previous document
+       **  and we may repaint it instead of the new one:
+       **  prev doc scrolled to the first line (=Newline_partial)
+       **  is not good looking :-)       23 Aug 1998 Leonid Pauzner
+       **
+       **  So repaint the page only when necessary:
        */
+       if (NumOfLines_partial != -1) {
+               /* new hypertext document available  */
        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/lymainlo.c ./lymainlo.c
--- old/lymainlo.c      Fri Aug 21 06:30:14 1998
+++ ./lymainlo.c        Sun Aug 23 02:13:54 1998
@@ -89,7 +89,7 @@

 #ifdef DISP_PARTIAL
 PUBLIC int Newline_partial = 0;     /* required for display_partial mode */
-PUBLIC int NumOfLines_partial = 0;  /* required for display_partial mode */
+PUBLIC int NumOfLines_partial = -1; /* required for display_partial mode */
 #endif

 PRIVATE document newdoc;
@@ -376,15 +376,7 @@
                     *  elements to the curdoc structure elements
                     *  under case NORMAL.  - FM
                     */
-#ifndef EXP_FORMS_OPTIONS
                    if (strncmp(newdoc.address, "LYNXDOWNLOAD:", 13))
-#else /* EXP_FORMS_OPTIONS */
-                   if (!strncmp(newdoc.address, "LYNXOPTIONS://MBM_MENU", 22))
-                       LYpush(&curdoc, ForcePush);
-
-                   if (strncmp(newdoc.address, "LYNXDOWNLOAD:", 13) &&
-                       strncmp(newdoc.address, "LYNXOPTIONS:", 12))
-#endif /* EXP_FORMS_OPTIONS */
                    {
                        LYpush(&curdoc, ForcePush);
                    }
@@ -509,7 +501,10 @@
 #ifdef DISP_PARTIAL
                display_partial = display_partial_flag; /* restore */
                Newline_partial = newdoc.line; /* initialize */
-               NumOfLines_partial = 0;        /* initialize */
+               NumOfLines_partial = -1;       /* initialize to -1 */
+                               /* -1 restrict HTDisplayPartial()   */
+                               /* until HText_new() start new HTMainText */
+                               /* and set the flag to 0  */
                if (display_partial) {
                    /*
                     * Disable display_partial if requested URL has #fragment.



reply via email to

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