Skip to content

Commit

Permalink
Merge pull request #1930 from H3rnand3zzz/cleanup/inputwin
Browse files Browse the repository at this point in the history
Minor `inputwin.c` refactoring/cleanup
  • Loading branch information
jubalh authored Nov 14, 2023
2 parents 08d2a51 + 3dcca35 commit 9bc68ea
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/ui/inputwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,16 @@ inp_win_resize(void)
}

wbkgd(inp_win, theme_attrs(THEME_INPUT_TEXT));
;

_inp_win_update_virtual();
}

void
inp_nonblocking(gboolean reset)
{
gint inpblock = prefs_get_inpblock();
if (!prefs_get_boolean(PREF_INPBLOCK_DYNAMIC)) {
inp_timeout = prefs_get_inpblock();
inp_timeout = inpblock;
return;
}

Expand All @@ -254,14 +255,14 @@ inp_nonblocking(gboolean reset)
no_input_count = 0;
}

if (inp_timeout < prefs_get_inpblock()) {
if (inp_timeout < inpblock) {
no_input_count++;

if (no_input_count % 10 == 0) {
inp_timeout += no_input_count;

if (inp_timeout > prefs_get_inpblock()) {
inp_timeout = prefs_get_inpblock();
if (inp_timeout > inpblock) {
inp_timeout = inpblock;
}
}
}
Expand Down

0 comments on commit 9bc68ea

Please sign in to comment.