From e16e33a18697a13cff2d961144a6df48c6f170ab Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sat, 21 Sep 2013 15:04:05 +0400 Subject: [PATCH] (input_update): don't do anything if widget is unowned or is in inactive dialog. Signed-off-by: Andrew Borodin --- lib/widget/input.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/widget/input.c b/lib/widget/input.c index cfeccfebe..8a654e9ea 100644 --- a/lib/widget/input.c +++ b/lib/widget/input.c @@ -1258,13 +1258,21 @@ input_update (WInput * in, gboolean clear_first) const char *cp; int pw; - if (should_show_history_button (in)) - has_history = HISTORY_BUTTON_WIDTH; - if (in->disable_update != 0) return; + /* don't draw widget not put into dialog */ + if (w->owner == NULL || w->owner->state != DLG_ACTIVE) + return; + + if (should_show_history_button (in)) + has_history = HISTORY_BUTTON_WIDTH; + buf_len = str_length (in->buffer); + + /* Adjust the mark */ + in->mark = min (in->mark, buf_len); + pw = str_term_width2 (in->buffer, in->point); /* Make the point visible */ @@ -1275,13 +1283,6 @@ input_update (WInput * in, gboolean clear_first) in->term_first_shown = 0; } - /* Adjust the mark */ - in->mark = min (in->mark, buf_len); - - /* don't draw widget not put into dialog */ - if (w->owner == NULL || w->owner->state != DLG_ACTIVE) - return; - if (has_history != 0) draw_history_button (in);