[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Off-screen panels/windows
From: |
Thomas Dickey |
Subject: |
Re: Off-screen panels/windows |
Date: |
Sat, 8 Aug 2020 17:44:48 -0400 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Sat, Aug 08, 2020 at 03:52:09PM -0400, Bill Gray wrote:
> Hello all,
>
> I've been working for some years on a fork of PDCurses. As a
> result, I often refer to ncurses to get a sense of what the
> behavior "ought" to be. (When there's a bug or poor behavior,
> it's almost always on the PDCurses side. I don't think I've
> encountered a reportable ncurses issue. This is my first post
> to this list, and it's still not because ncurses is wrong.)
>
> Recently, I investigated some issues in the PDCurses panels
> library. I wrote a small demo to put three panels on-screen :
>
> https://github.com/Bill-Gray/PDCursesMod/blob/master/demos/test_pan.c
>
> Run this in a terminal, grab the lower right corner of the terminal
> and shrink it so that the windows stick off-screen, and it all works
> if the program is compiled with ncurses. To my knowledge, this is
> the only way in ncurses or PDCurses to get a window to be partly or
> completely off-screen. You can't call mvwin() to do it, but if a
> user resizes the terminal, ncurses handles the off-screen panel
> correctly. (Are there other ways to get partially or fully off-screen
hmm - ncurses' resizeterm doesn't pay attention to panels (just windows).
I'd expect the windows associated with the panels to be resized/limited
to be on-screen (if not, a bug...)
> windows/panels in ncurses?)
>
> My fork of PDCurses crashed when required to handle off-screen
> panels/windows, but that was easy to fix.
>
> I then tried commenting out lines 294-296 at
>
> https://github.com/Bill-Gray/PDCursesMod/blob/126a8df8f33e64439a12e7ecbe0685804d0ef00c/pdcurses/window.c#L294
>
> ...i.e., "go ahead and allow mvwin() to put windows off-screen."
> Thus far, I've seen no problems with this; I can move panels
> partly or completely off-screen, much as one can with windows in
> a traditional GUI. Which seems as if it could be useful.
>
> Is there a reason ncurses requires windows/panels to be on-screen
> (with the exception of resized terminals)? Out of caution, I'm
iirc, it's for compatibility with SVr4 curses
though that X/Open Curses in general has that, because of mvwin:
https://pubs.opengroup.org/onlinepubs/7908799/xcurses/mvwin.html
(that is, you shouldn't be able to create a window in a place that you
can't move the window to).
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: PGP signature