From 1a74630f9654033b92b0fe286232bff46a5ebc41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net> Date: Mon, 28 Oct 2024 12:45:46 -0400 Subject: [PATCH] When RIP changes the vstat mode, also change the cursor When changing between 8 and 16 row fonts in RIP mode, the cursor start and end was left for the old font size... 16 -> 8 would leave the cursor one line below the current position, and 8 -> 16 would leave the cursor in the middle of the cell. This hacks the vstat deeper to fix up the cursor as well. Reported by skipperdoodle1947. --- src/syncterm/ripper.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/syncterm/ripper.c b/src/syncterm/ripper.c index 84ca3f258c..28a3f88500 100644 --- a/src/syncterm/ripper.c +++ b/src/syncterm/ripper.c @@ -10080,6 +10080,7 @@ reinit_screen(uint8_t *font, int fx, int fy) int rows = 43; void *nvmem; uint32_t lcf; + bool fh_change; rip_did_reinit = true; hold_update = 0; @@ -10098,6 +10099,7 @@ reinit_screen(uint8_t *font, int fx, int fy) if (font == ripfnt16x14) cols = 40; pthread_mutex_lock(&vstatlock); + fh_change = fy != vstat.charheight; rows = vstat.scrnheight / fy; if ((font != vstat.forced_font) || (fx != vstat.charwidth) || (fy != vstat.charheight)) { vstat.forced_font = font; @@ -10105,6 +10107,15 @@ reinit_screen(uint8_t *font, int fx, int fy) vstat.charheight = fy; vstat.cols = cols; vstat.rows = rows; + if (fh_change) { + if (fy > 8) + vstat.default_curs_start = vstat.charheight - 2; + else + vstat.default_curs_start = vstat.charheight - 1; + vstat.default_curs_end = vstat.charheight - 1; + vstat.curs_start = vstat.default_curs_start; + vstat.curs_end = vstat.default_curs_end; + } // We need to update gettextinfo() results as well... cio_textinfo.screenwidth = cols; -- GitLab