summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2020-05-08 16:57:18 -0600
committerEduardo Chappa <chappa@washington.edu>2020-05-08 16:57:18 -0600
commit4dc6d4636706e454d042bc599be9f97660f2e2b1 (patch)
treeb5ac2052297336bfb208053dc4f862aa1fc2320d
parent380d6c37f7f1d21d94210a74bff3f9a59ca6423d (diff)
downloadalpine-4dc6d4636706e454d042bc599be9f97660f2e2b1.tar.xz
* Attempt to clear bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=956361
where scrolling can be broken by resizing the screen.
-rw-r--r--alpine/mailview.c25
-rw-r--r--pith/pine.hlp4
2 files changed, 26 insertions, 3 deletions
diff --git a/alpine/mailview.c b/alpine/mailview.c
index 3889425..eec5805 100644
--- a/alpine/mailview.c
+++ b/alpine/mailview.c
@@ -2296,7 +2296,8 @@ scrolltool(SCROLL_S *sparms)
UCS ch;
int result, done, cmd, found_on, found_on_index,
first_view, force, scroll_lines, km_size,
- cursor_row, cursor_col, km_popped;
+ cursor_row, cursor_col, km_popped,
+ nrows, ncols;
char *utf8str;
long jn;
struct key_menu *km;
@@ -2310,7 +2311,8 @@ scrolltool(SCROLL_S *sparms)
ps_global->mangled_header = 1;
ps_global->mangled_footer = 1;
ps_global->mangled_body = !sparms->body_valid;
-
+ ncols = ps_global->ttyo ? ps_global->ttyo->screen_cols : 0;
+ nrows = ps_global->ttyo ? ps_global->ttyo->screen_rows : 0;
what = sparms->keys.what; /* which key menu to display */
cur_top_line = 0;
@@ -2624,6 +2626,10 @@ scrolltool(SCROLL_S *sparms)
if(ps_global->prev_screen == mail_view_screen)
mswin_setviewinwindcallback(view_in_new_window);
#endif
+ if(cmd == MC_RESIZE
+ || ps_global->ttyo == NULL
+ || (ps_global->ttyo->screen_cols == ncols
+ && ps_global->ttyo->screen_rows == nrows))
ch = (sparms->quell_newmail || read_command_prep()) ? read_command(&utf8str) : NO_OP_COMMAND;
#ifdef MOUSE
#ifndef WIN32
@@ -2639,8 +2645,21 @@ scrolltool(SCROLL_S *sparms)
mswin_setviewinwindcallback(NULL);
cur_top_line = scroll_state(SS_CUR)->top_text_line;
#endif
+ /* we need to check if there was a resize of the screen
+ * which did not happen in this routine but during a call
+ * to another routine from this routing, and that routine has no
+ * way to tell us that a resize happened
+ */
+ if(cmd != MC_RESIZE
+ && ps_global->ttyo
+ && (ps_global->ttyo->screen_cols != ncols
+ || ps_global->ttyo->screen_rows != nrows))
+ cmd = MC_RESIZE;
+ else
+ cmd = menu_command(ch, km);
- cmd = menu_command(ch, km);
+ ncols = ps_global->ttyo ? ps_global->ttyo->screen_cols : 0;
+ nrows = ps_global->ttyo ? ps_global->ttyo->screen_rows : 0;
if(km_popped)
switch(cmd){
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 0183150..e271745 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -232,6 +232,10 @@ Bugs that have been addressed include:
<LI> When an html anchor does not quote the link in the href parameter,
alpine does not link to it.
+
+<LI> Attempt to fix a bug that breaks scrolling of a message in Alpine when
+ the screen is resized. Reported in the Debian bug system at
+ <A HREF="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=956361">https://bugs.debian.org/cgi-bin/bugreport.cgie?bug=956361</A>.
</UL>
<P>