fix H2488 - wide and/or tall screens don't work
Make windows with more than 255 rows or columns work. Touches some very old magic involving the constant 10.
This commit is contained in:
+3
-3
@@ -28,7 +28,7 @@ struct WinDesc {
|
|||||||
int flags; /* window flags */
|
int flags; /* window flags */
|
||||||
xchar type; /* type of window */
|
xchar type; /* type of window */
|
||||||
boolean active; /* true if window is active */
|
boolean active; /* true if window is active */
|
||||||
uchar offx, offy; /* offset from topleft of display */
|
short offx, offy; /* offset from topleft of display */
|
||||||
short rows, cols; /* dimensions */
|
short rows, cols; /* dimensions */
|
||||||
short curx, cury; /* current cursor position */
|
short curx, cury; /* current cursor position */
|
||||||
short maxrow, maxcol; /* the maximum size used -- for MENU wins */
|
short maxrow, maxcol; /* the maximum size used -- for MENU wins */
|
||||||
@@ -53,8 +53,8 @@ struct WinDesc {
|
|||||||
|
|
||||||
/* descriptor for tty-based displays -- all the per-display data */
|
/* descriptor for tty-based displays -- all the per-display data */
|
||||||
struct DisplayDesc {
|
struct DisplayDesc {
|
||||||
uchar rows, cols; /* width and height of tty display */
|
short rows, cols; /* width and height of tty display */
|
||||||
uchar curx, cury; /* current cursor position on the screen */
|
short curx, cury; /* current cursor position on the screen */
|
||||||
#ifdef TEXTCOLOR
|
#ifdef TEXTCOLOR
|
||||||
int color; /* current color */
|
int color; /* current color */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+10
-6
@@ -1714,7 +1714,7 @@ struct WinDesc *cw;
|
|||||||
n = 0;
|
n = 0;
|
||||||
}
|
}
|
||||||
tty_curs(window, 1, n++);
|
tty_curs(window, 1, n++);
|
||||||
if (cw->offx) cl_end();
|
cl_end();
|
||||||
if (cw->data[i]) {
|
if (cw->data[i]) {
|
||||||
attr = cw->data[i][0] - 1;
|
attr = cw->data[i][0] - 1;
|
||||||
if (cw->offx) {
|
if (cw->offx) {
|
||||||
@@ -1738,6 +1738,10 @@ struct WinDesc *cw;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i == cw->maxrow) {
|
if (i == cw->maxrow) {
|
||||||
|
if(cw->type == NHW_TEXT){
|
||||||
|
tty_curs(BASE_WINDOW, 0, (int)ttyDisplay->cury+1);
|
||||||
|
cl_eos();
|
||||||
|
}
|
||||||
tty_curs(BASE_WINDOW, (int)cw->offx + 1,
|
tty_curs(BASE_WINDOW, (int)cw->offx + 1,
|
||||||
(cw->type == NHW_TEXT) ? (int) ttyDisplay->rows - 1 : n);
|
(cw->type == NHW_TEXT) ? (int) ttyDisplay->rows - 1 : n);
|
||||||
cl_end();
|
cl_end();
|
||||||
@@ -1789,14 +1793,14 @@ tty_display_nhwindow(window, blocking)
|
|||||||
/*FALLTHRU*/
|
/*FALLTHRU*/
|
||||||
case NHW_MENU:
|
case NHW_MENU:
|
||||||
cw->active = 1;
|
cw->active = 1;
|
||||||
/* avoid converting to uchar before calculations are finished */
|
cw->offx = (cw->type==NHW_TEXT)
|
||||||
cw->offx = (uchar) (int)
|
? 0
|
||||||
max((int) 10, (int) (ttyDisplay->cols - cw->maxcol - 1));
|
: min(10, ttyDisplay->cols - cw->maxcol - 1);
|
||||||
if(cw->type == NHW_MENU)
|
if(cw->type == NHW_MENU)
|
||||||
cw->offy = 0;
|
cw->offy = 0;
|
||||||
if(ttyDisplay->toplin == 1)
|
if(ttyDisplay->toplin == 1)
|
||||||
tty_display_nhwindow(WIN_MESSAGE, TRUE);
|
tty_display_nhwindow(WIN_MESSAGE, TRUE);
|
||||||
if(cw->offx == 10 || cw->maxrow >= (int) ttyDisplay->rows) {
|
if(cw->maxrow >= (int) ttyDisplay->rows) {
|
||||||
cw->offx = 0;
|
cw->offx = 0;
|
||||||
if(cw->offy) {
|
if(cw->offy) {
|
||||||
tty_curs(window, 1, 0);
|
tty_curs(window, 1, 0);
|
||||||
@@ -2540,7 +2544,7 @@ tty_end_menu(window, prompt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (len > (int)ttyDisplay->cols) {
|
if (len > (int)ttyDisplay->cols) {
|
||||||
/* truncate the prompt if its too long for the screen */
|
/* truncate the prompt if it's too long for the screen */
|
||||||
if (cw->npages <= 1) /* only str in single page case */
|
if (cw->npages <= 1) /* only str in single page case */
|
||||||
cw->morestr[ttyDisplay->cols] = 0;
|
cw->morestr[ttyDisplay->cols] = 0;
|
||||||
len = ttyDisplay->cols;
|
len = ttyDisplay->cols;
|
||||||
|
|||||||
Reference in New Issue
Block a user