diff options
author | HoverHell <hoverhell@gmail.com> | 2010-07-31 14:46:24 +0200 |
---|---|---|
committer | Amadeusz Sławiński <amade@asmblr.net> | 2015-06-08 23:16:00 +0200 |
commit | 8ad0dcf92382f6476de01901b3e04f1a36c315b2 (patch) | |
tree | e1db49e5ac8e0c43911a26354e60ad81a779b7bc | |
parent | cbd56846a7cff9470b4a0865a8f7ce3c8f22a93a (diff) | |
download | screen-8ad0dcf92382f6476de01901b3e04f1a36c315b2.tar.gz |
Apply hardstatusfirstline.patch on git
Adapted on top of git sources, patch from:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512342
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
-rw-r--r-- | src/canvas.c | 2 | ||||
-rw-r--r-- | src/display.c | 24 | ||||
-rw-r--r-- | src/display.h | 3 | ||||
-rw-r--r-- | src/layout.c | 1 | ||||
-rw-r--r-- | src/process.c | 6 | ||||
-rw-r--r-- | src/resize.c | 1 |
6 files changed, 33 insertions, 4 deletions
diff --git a/src/canvas.c b/src/canvas.c index 0121892..93177cb 100644 --- a/src/canvas.c +++ b/src/canvas.c @@ -375,7 +375,7 @@ MakeDefaultCanvas() return -1; cv->c_xs = 0; cv->c_xe = D_width - 1; - cv->c_ys = 0; + cv->c_ys = (D_has_hstatus == HSTATUS_FIRSTLINE); cv->c_ye = D_height - 1 - (D_has_hstatus == HSTATUS_LASTLINE) - captionalways; debug2("MakeDefaultCanvas 0,0 %d,%d\n", cv->c_xe, cv->c_ye); cv->c_xoff = 0; diff --git a/src/display.c b/src/display.c index 8161e1e..e02450d 100644 --- a/src/display.c +++ b/src/display.c @@ -2242,6 +2242,28 @@ char *str; D_hstatus = *str ? 1 : 0; SetRendition(&mchar_null); } + else if (D_has_hstatus == HSTATUS_FIRSTLINE) + { + debug("ShowHStatus: using first line\n"); + ox = D_x; + oy = D_y; + str = str ? str : ""; + l = strlen(str); + if (l > D_width) + l = D_width; + GotoPos(0, 0); + SetRendition(captionalways || D_cvlist == 0 || D_cvlist->c_next ? &mchar_null: &mchar_so); + l = PrePutWinMsg(str, 0, l); + if (!captionalways || D_cvlist && !D_cvlist->c_next) + while (l++ < D_width) + PUTCHARLP(' '); + if (l < D_width) + ClearArea(l, 0, l, D_width - 1, D_width - 1, 0, 0, 0); + if (ox != -1 && oy != -1) + GotoPos(ox, oy); + D_hstatus = *str ? 1 : 0; + SetRendition(&mchar_null); + } else if (str && *str && D_has_hstatus == HSTATUS_MESSAGE) { debug("ShowHStatus: using message\n"); @@ -2346,7 +2368,7 @@ int y, from, to, isblank; isblank = 1; } - if (y == D_height - 1 && D_has_hstatus == HSTATUS_LASTLINE) + if (y == D_height - 1 && D_has_hstatus == HSTATUS_LASTLINE || (y == 0 && D_has_hstatus == HSTATUS_FIRSTLINE) ) { RefreshHStatus(); return; diff --git a/src/display.h b/src/display.h index a433e6d..19dded7 100644 --- a/src/display.h +++ b/src/display.h @@ -320,7 +320,8 @@ while (0) #define HSTATUS_LASTLINE 1 #define HSTATUS_MESSAGE 2 #define HSTATUS_HS 3 -#define HSTATUS_ALWAYS (1<<2) +#define HSTATUS_FIRSTLINE 4 +#define HSTATUS_ALWAYS (1<<3) #endif /* SCREEN_DISPLAY_H */ diff --git a/src/layout.c b/src/layout.c index 584abbd..ec0c400 100644 --- a/src/layout.c +++ b/src/layout.c @@ -171,6 +171,7 @@ struct canvas *cv; if (!D_forecv) MakeDefaultCanvas(); DupLayoutCv(&lay->lay_canvas, &D_canvas, 0); + D_canvas.c_ys = (D_has_hstatus == HSTATUS_FIRSTLINE); D_canvas.c_ye = D_height - 1 - ((D_canvas.c_slperp && D_canvas.c_slperp->c_slnext) || captionalways) - (D_has_hstatus == HSTATUS_LASTLINE); ResizeCanvas(&D_canvas); RecreateCanvasChain(); diff --git a/src/process.c b/src/process.c index 11f9928..1f83573 100644 --- a/src/process.c +++ b/src/process.c @@ -2858,7 +2858,9 @@ int key; s = args[0]; if (!strncmp(s, "always", 6)) s += 6; - if (!strcmp(s, "lastline")) + if (!strcmp(s, "firstline")) + new_use = HSTATUS_FIRSTLINE; + else if (!strcmp(s, "lastline")) new_use = HSTATUS_LASTLINE; else if (!strcmp(s, "ignore")) new_use = HSTATUS_IGNORE; @@ -2893,6 +2895,8 @@ int key; D_has_hstatus = new_use; if ((new_use == HSTATUS_LASTLINE && old_use != HSTATUS_LASTLINE) || (new_use != HSTATUS_LASTLINE && old_use == HSTATUS_LASTLINE)) ChangeScreenSize(D_width, D_height, 1); + if ((new_use == HSTATUS_FIRSTLINE && old_use != HSTATUS_FIRSTLINE) || (new_use != HSTATUS_FIRSTLINE && old_use == HSTATUS_FIRSTLINE)) + ChangeScreenSize(D_width, D_height, 1); RefreshHStatus(); } } diff --git a/src/resize.c b/src/resize.c index ba30b26..d48be5f 100644 --- a/src/resize.c +++ b/src/resize.c @@ -162,6 +162,7 @@ int change_fore; cv = &D_canvas; cv->c_xe = wi - 1; + cv->c_ys = (D_has_hstatus == HSTATUS_FIRSTLINE); cv->c_ye = he - 1 - ((cv->c_slperp && cv->c_slperp->c_slnext) || captionalways) - (D_has_hstatus == HSTATUS_LASTLINE); cv->c_blank.l_height = cv->c_ye - cv->c_ys + 1; if (cv->c_slperp) |