From e02806b6e230ef092eefb8f714bf654259bb1bd5 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Wed, 23 Oct 2013 19:51:31 +0200 Subject: [PATCH] get rid of the hide_inputbar hack We no longer need to hide the inputbar to get the right jump position, since now showing or hiding the inputbar does not change the position stored in the document object. Wen the adjustments get resized, the changed_callback resets the value from what is stored in the document object, effectively recentering the position to the middle of the viewport. --- zathura.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/zathura.c b/zathura.c index b95ab75..86f3f8e 100644 --- a/zathura.c +++ b/zathura.c @@ -1133,39 +1133,6 @@ refresh_view(zathura_t* zathura) { 0, zathura); } -static void -zathura_jumplist_hide_inputbar(zathura_t* zathura) -{ - g_return_if_fail(zathura != NULL && zathura->ui.session->gtk.inputbar != NULL); - - girara_argument_t arg = { GIRARA_HIDE, NULL }; - girara_isc_completion(zathura->ui.session, &arg, NULL, 0); - - if (zathura->ui.session->global.autohide_inputbar == true) { - /* XXX: This is a workaround for incremental-search. We should revisit this - * when we drop GTK+3 support and the inputbar is placed in a GtkOverlay - * widget. */ - 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); - } - - /* we want to do it immediately */ - /* XXX: ... and we want this to go away */ - while (gtk_events_pending()) { - gtk_main_iteration(); - } -} bool adjust_view(zathura_t* zathura) { @@ -1329,7 +1296,6 @@ void zathura_jumplist_add(zathura_t* zathura) { g_return_if_fail(zathura != NULL && zathura->document != NULL && zathura->jumplist.list != NULL); - zathura_jumplist_hide_inputbar(zathura); unsigned int pagenum = zathura_document_get_current_page_number(zathura->document); double x = zathura_document_get_position_x(zathura->document);