From c5e593d3c52f9da18cc0643334ea0e1a335237f1 Mon Sep 17 00:00:00 2001 From: Marawan Tanager Date: Thu, 8 Aug 2013 19:48:31 +0200 Subject: [PATCH] Don't hide the inputbar in case of incremental search Hiding the inputbar immediately before jumping breaks incremental search, as Guillaume Duranceau stated in an earlier mail. This patch makes an exception for the case of incremental search, at the cost of a slight displacement when jumping back (^o) after ending the incremental search (pressing the ESC key). The rest of the jump cases are unaffected. This should makes things usable for now, until we move to GTK3 (link to it by default) which has a new widget that suits this problem nicely (GtkOverlay), as demonstrated by an earlier patch by Abdo Roig-Maranges which is now included on the develop branch in girara repo as commit 70fd1cf354ee1300d4a9bdab9e939d5cc975979e, but is compiled only with GTK3. Signed-off-by: Sebastian Ramacher --- zathura.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/zathura.c b/zathura.c index 5506c2c..4de8c8c 100644 --- a/zathura.c +++ b/zathura.c @@ -1188,6 +1188,17 @@ zathura_jumplist_hide_inputbar(zathura_t* zathura) girara_isc_completion(zathura->ui.session, &arg, NULL, 0); if (zathura->ui.session->global.autohide_inputbar == true) { + char *input = gtk_editable_get_chars(GTK_EDITABLE(zathura->ui.session->gtk.inputbar_entry), 0, -1); + bool res = false; + + girara_setting_get(zathura->ui.session, "incremental-search", &res); + + if ((*input == '/' || *input == '?') && res == true) { + g_free(input); + + return; + } + gtk_widget_hide(zathura->ui.session->gtk.inputbar); }