From 4472ad416ffe2c6d713b340b48d989f5d632bfa7 Mon Sep 17 00:00:00 2001 From: ketmar Date: Fri, 1 Jun 2012 04:30:46 +0300 Subject: [PATCH] ah, another one option! meet the swapdrawtimeout! --- .sterm.rc | 1 + src/sterm.c | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.sterm.rc b/.sterm.rc index 1e02314..dd17563 100644 --- a/.sterm.rc +++ b/.sterm.rc @@ -10,6 +10,7 @@ tripleclicktimeout 600 drawtimeout 20 maxdrawtimeout 1500 # 100..60000, milliseconds +swapdrawtimeout 200 # max timeout after screen swapping fastredraw no # don't set this to yes, it actually will SLOWDOWN redraw audiblebell 1 diff --git a/src/sterm.c b/src/sterm.c index 3a26b2d..097dc0a 100644 --- a/src/sterm.c +++ b/src/sterm.c @@ -514,6 +514,7 @@ static int opt_cursorBlinkInactive = 0; static int opt_drawunderline = 1; static int opt_ignoreclose = 0; static int opt_maxdrawtimeout = 1500; +static int opt_swapdrawtimeout = 200; static int opt_fastredraw = 0; static int ptrBlanked = 0; static int ptrLastMove = 0; @@ -4889,8 +4890,9 @@ static inline int last_draw_too_old (void) { // if (term != NULL) { if (term->dead || !term->wantRedraw) return 0; - if (!term->justSwapped) return (tt-term->lastDrawTime >= opt_drawtimeout) || (tt-lastDrawTime >= opt_maxdrawtimeout); - return (tt-term->lastDrawTime >= opt_drawtimeout) || (tt-lastDrawTime >= 100); + return + (tt-term->lastDrawTime >= opt_drawtimeout || + tt-lastDrawTime >= (term->justSwapped ? opt_swapdrawtimeout : opt_maxdrawtimeout)); } return (tt-lastDrawTime >= opt_maxdrawtimeout); //if (IS_SET(MODE_ALTSCREEN)) draw(0); @@ -5120,7 +5122,8 @@ static const IniCommand iniCommands[] = { {"cursorblinkinactive", "b", &opt_cursorBlinkInactive, inifnGenericOneArg}, {"drawunderline", "b", &opt_drawunderline, inifnGenericOneArg}, {"ignoreclose", "i{-1,1}", &opt_ignoreclose, inifnGenericOneArg}, - {"maxdrawtimeout", "i{100,60000}", &opt_maxdrawtimeout, inifnGenericOneArg}, + {"maxdrawtimeout", "i{10,60000}", &opt_maxdrawtimeout, inifnGenericOneArg}, + {"swapdrawtimeout", "i{10,60000}", &opt_swapdrawtimeout, inifnGenericOneArg}, {"fastredraw", "b", &opt_fastredraw, inifnGenericOneArg}, {NULL, NULL, NULL, NULL} }; @@ -5864,6 +5867,20 @@ static void cmdMaxDrawTimeout (const char *cmdname, char *argstr) { } +static void cmdSwapDrawTimeout (const char *cmdname, char *argstr) { + int b = -1; + // + if (term == NULL) return; + if (cmd_parseIntArg("i{10,60000}", argstr, &b, NULL, NULL) != 0) return; + // + if (b == -1) { + tcmdlinemsgf("SwapDrawTimeout: %d", opt_swapdrawtimeout); + } else { + opt_swapdrawtimeout = b; + } +} + + static void cmdTabPosition (const char *cmdname, char *argstr) { int newpos = -1; // @@ -5981,6 +5998,7 @@ static const Command commandList[] = { {"IgnoreClose", cmdIgnoreClose}, {"MaxHistory", cmdMaxHistory}, {"MaxDrawTimeout", cmdMaxDrawTimeout}, + {"SwapDrawTimeout", cmdSwapDrawTimeout}, {"TabPosition", cmdTabPosition}, {"TabCount", cmdTabCount}, {"DoFullRedraw", cmdDoFullRedraw}, -- 2.11.4.GIT