bug-ncurses
[Top][All Lists]
Advanced

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

found the problem with resizing windows


From: Folkert van Heusden
Subject: found the problem with resizing windows
Date: Thu, 22 Jul 2004 20:12:23 +0200 (CEST)

At last!
I found the problem with resizing sometimes failing!
I always used subwin(stdscr, ...) for creating windows and it seems that
when resizing very quick the internal variables are not always updated
correctly. I added extensive logging to ncurses and found that:

derwin: too large, max_y/x: 33x91, actual: 36x91

this means: the caller tries to create a window of 36x91 while the stdscr is
still known to be 33x91.

NCURSES_EXPORT(WINDOW *)
derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx)
...
    /*
     * make sure window fits inside the original one
     */
    if (begy < 0 || begx < 0 || orig == 0 || num_lines < 0 || num_columns <
0)
    {
        syslog(LOG_ERR, "derwin: coords/sizes out of bounds: %dx%d, %dx%d,
orig: %p", num_lines, num_columns, begy, begx, orig
);
        returnWin(0);
    }
    if (begy + num_lines > orig->_maxy + 1
        || begx + num_columns > orig->_maxx + 1)
    {
        syslog(LOG_ERR, "derwin: too large, max_y/x: %dx%d, actual: %dx%d",
orig->_maxy + 1, orig->_maxx + 1, begy + num_lines
, begx + num_columns);
        returnWin(0);
    }
...

Not sure if it is a bug but my solution is now that I use newwin(...).


Folkert van Heusden

+------------------------------------------------------------------+
|UNIX admin? Then give MultiTail (http://vanheusden.com/multitail/)|
|a try, it brings monitoring logfiles to a different level! See    |
|http://vanheusden.com/multitail/features.html for a feature list. |
+------------------------------------------= www.unixsoftware.nl =-+





reply via email to

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