summaryrefslogtreecommitdiff
path: root/shell/ev-window.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2015-08-26 17:04:43 +0300
committerinfirit <[email protected]>2015-08-31 14:51:17 +0200
commit37f48ea5fcb08871d32813f3986fec349ebad912 (patch)
treed1d8f61c677868077039e741871ebbb55dfc1914 /shell/ev-window.c
parent46100f0deb15e2acf100ac7b4f5e2cd27b27e33d (diff)
downloadatril-37f48ea5fcb08871d32813f3986fec349ebad912.tar.bz2
atril-37f48ea5fcb08871d32813f3986fec349ebad912.tar.xz
make sure findbar is visible when using --find command line option
from https://git.gnome.org/browse/evince/commit/?id=a11159d1b8ea994271b26b5c60083c0b07c1722d
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r--shell/ev-window.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index b52c32ba..edec70ff 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -1532,10 +1532,21 @@ ev_window_setup_document (EvWindow *ev_window)
info = ev_document_get_info (document);
update_document_mode (ev_window, info->mode);
+
+ if (EV_IS_DOCUMENT_FIND (document)) {
+ if (ev_window->priv->search_string &&
+ !EV_WINDOW_IS_PRESENTATION (ev_window)) {
+ ev_window_cmd_edit_find (NULL, ev_window);
+ egg_find_bar_set_search_string (EGG_FIND_BAR (ev_window->priv->find_bar), ev_window->priv->search_string);
+ }
+
+ g_clear_pointer (&ev_window->priv->search_string, g_free);
+ }
+
/*FIXME*/
if (EV_WINDOW_IS_PRESENTATION (ev_window) && document->iswebdocument == FALSE)
gtk_widget_grab_focus (ev_window->priv->presentation_view);
- else {
+ else if (!gtk_widget_get_visible (ev_window->priv->find_bar)) {
if ( document->iswebdocument == FALSE )
gtk_widget_grab_focus (ev_window->priv->view);
#if ENABLE_EPUB
@@ -1749,16 +1760,6 @@ ev_window_load_job_cb (EvJob *job,
break;
}
- if (ev_window->priv->search_string && EV_IS_DOCUMENT_FIND (document) &&
- ev_window->priv->window_mode != EV_WINDOW_MODE_PRESENTATION) {
- ev_window_cmd_edit_find (NULL, ev_window);
- egg_find_bar_set_search_string (EGG_FIND_BAR (ev_window->priv->find_bar),
- ev_window->priv->search_string);
- }
-
- g_free (ev_window->priv->search_string);
- ev_window->priv->search_string = NULL;
-
/* Create a monitor for the document */
ev_window->priv->monitor = ev_file_monitor_new (ev_window->priv->uri);
g_signal_connect_swapped (ev_window->priv->monitor, "changed",