[Vimprobable-users] [PATCH] Don't modify the input bar if it's focused
Vimprobable is a lean web browser optimised for full keyboard control
Brought to you by:
hanness
From: Hans-Peter D. <hpd...@gm...> - 2012-04-27 21:42:28
|
Prevents echo() from setting the text of the input bar if it has the focus (i.e. the user is currently typing something). --- main.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 029ac7c..729ace4 100644 --- a/main.c +++ b/main.c @@ -1041,8 +1041,10 @@ echo(const Arg *arg) { if (index < Info || index > Error) return TRUE; - set_widget_font_and_color(inputbox, urlboxfont[index], urlboxbgcolor[index], urlboxcolor[index]); - gtk_entry_set_text(GTK_ENTRY(inputbox), !arg->s ? "" : arg->s); + if (!gtk_widget_is_focus(GTK_WIDGET(inputbox))) { + set_widget_font_and_color(inputbox, urlboxfont[index], urlboxbgcolor[index], urlboxcolor[index]); + gtk_entry_set_text(GTK_ENTRY(inputbox), !arg->s ? "" : arg->s); + } return TRUE; } -- 1.7.3.4 |