Fix flaky scrollbar update when scrollback was reset to bottom.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 18 Sep 2001 19:04:21 +0000 (19:04 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 18 Sep 2001 19:04:21 +0000 (19:04 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@1275 cda61777-01e9-0310-a592-d414129be87e

terminal.c

index f238f09..5245cdb 100644 (file)
@@ -319,13 +319,15 @@ void term_update(void)
     Context ctx;
     ctx = get_ctx();
     if (ctx) {
-       if (seen_disp_event)
-           update_sbar();
+       int need_sbar_update = seen_disp_event;
        if ((seen_key_event && (cfg.scroll_on_key)) ||
            (seen_disp_event && (cfg.scroll_on_disp))) {
            disptop = 0;               /* return to main screen */
            seen_disp_event = seen_key_event = 0;
+           need_sbar_update = TRUE;
        }
+       if (need_sbar_update)
+           update_sbar();
        do_paint(ctx, TRUE);
        sys_cursor(curs.x, curs.y - disptop);
        free_ctx(ctx);