Discussion:
[zathura] [Zathura PATCH] Don't hide the inputbar in case of incremental search
Marwan Tanager
2013-08-08 17:48:31 UTC
Permalink
From: Marawan Tanager <marwan.tngr at gmail.com>

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.

---
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);
}
--
1.7.10.4
Loading...