-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
wresize doesn't return ERR if the window size requested is too big #162
Comments
It should be fixed, but this is probably not the way. There's a difference in the way PDCurses and ncurses handle windows that don't fit the screen, and we probably should do it their way for maximum portability, and that's a deeper change. See e.g. issue #85 . |
I think the only difference is that in ncurses, The ncurses behavior is somewhat inconsistent, in that while you can create a window going off those two edges, you can't move a window there. And I don't see why, if you can have a window run over one edge, you shouldn't be able to have it run over the other two. The only way I can think of to get a partially off-screen window (as opposed to a pad) in PDCurses is to resize the screen such that the window goes off the right or bottom edges. (It works that way in ncurses as well.) |
Yeah I was reading up on that earlier, seems unfortunate but I understand if you want to leave this compatibility with ncurses in. However I do think it crashing is problematic. |
Hi there,
I've been fixing my implementation of resize for my game and noticed that if you call
wresize
with a window that doesn't fit withinSP->lines
andSP->cols
it doesn't return ERR. This was a problem for me because my program would callwtouchwin
immediately after and segfault.I took a look at
newwin
and it has protection against this case, butwresize
does not.PDCurses/pdcurses/window.c
Lines 276 to 277 in 5c62af0
For my program I wrote a dumb little wrapper around wresize that performs the check:
Thank you so much for your time.
The text was updated successfully, but these errors were encountered: