lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev Curses and Resize [trial PATCH]


From: pg
Subject: Re: lynx-dev Curses and Resize [trial PATCH]
Date: Wed, 16 Aug 2000 07:54:08 -0600 (MDT)

In a recent note, Thomas Dickey said:

> Date: Wed, 16 Aug 2000 06:26:25 -0400
> 
> > I'm still playing with the problems resizing a window using
> > standard curses (not ncurses; not slang)  I'm trying to
> 
> btw, was this Solaris or os390?  (I haven't tested it in a while, but
> thought that endwin/refresh worked adequately).
> 
Both, with different forms of screen corruption.  I've tracked down
the first couple misbehaviors:

o On OS/390, if environment variables LINES and COLUMNS are not set
  when Lynx is executed, Lynx/Curses uses the standard 24x80 screen.

o On Solaris, settings of the environment variables override the actual
  screen size.

The attached patch reverses both these behaviors:

o size_change() loads LINES and COLUMNS from LYlines and LYcols.

o A call to size_change during initialization defines these
  variables initially.

So I no longer need to "export LINES COLUMNS" on OS/390 nor unset
them on Solaris.  This seems compatible with the operation of X/Open
Curses described in:

File that you are currently viewing

   Linkname: X/Open Curses Issue 4, Version 2 - Index
        URL: http://www.opengroup.org/onlinepubs/007908799/cursesix.html

Link that you currently have selected

   Linkname: use_env
        URL: http://www.opengroup.org/onlinepubs/007908799/xcurses/use_env.html

I'm calling this a "trial patch" because I have no idea what it will break on
systems I can't test.  In fact, I've sometimes found the Solaris environment
variable behavior useful even though on the balance it's a nuisance.

-- gil
-- 
StorageTek
INFORMATION made POWERFUL
########################################################################
%%% Created Tue Aug 15 23:56:06 MDT 2000 by target lynx.patch. %%%
diff -bru orig/lynx2-8-4/src/LYCurses.c lynx2-8-4/src/LYCurses.c
--- orig/lynx2-8-4/src/LYCurses.c       Thu Aug  3 11:19:52 2000
+++ lynx2-8-4/src/LYCurses.c    Tue Aug 15 23:00:20 2000
@@ -791,6 +791,7 @@
         *  If we're not VMS then only do initscr() one time,
         *  and one time only!
         */
+       size_change(0);
        if (initscr() == NULL) {  /* start curses */
            fprintf(tfp, "%s\n",
                gettext("Terminal initialisation failed - unknown terminal 
type?"));
diff -bru orig/lynx2-8-4/src/LYUtils.c lynx2-8-4/src/LYUtils.c
--- orig/lynx2-8-4/src/LYUtils.c        Thu Aug  3 11:19:52 2000
+++ lynx2-8-4/src/LYUtils.c     Tue Aug 15 23:48:28 2000
@@ -3382,6 +3382,13 @@
      * Check if the screen size has actually changed. - AJL
      */
     if (LYlines != old_lines || LYcols != old_cols) {
+       static char lines_putenv[15],
+                   cols_putenv[15];
+
+       sprintf(lines_putenv, "LINES=%d",   LYlines & 0xfff);
+       putenv(lines_putenv);
+       sprintf(cols_putenv,  "COLUMNS=%d", LYcols & 0xfff);
+       putenv(cols_putenv);
        recent_sizechange = TRUE;
        CTRACE((tfp, "Window size changed from (%d,%d) to (%d,%d)\n",
                old_lines, old_cols, LYlines, LYcols));

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

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