From 46100f0deb15e2acf100ac7b4f5e2cd27b27e33d Mon Sep 17 00:00:00 2001 From: monsta Date: Wed, 26 Aug 2015 16:08:20 +0300 Subject: don't show findbar in presentation mode (search doesn't work there) from https://git.gnome.org/browse/evince/commit/?id=79b9e1e0d6efa05a875e0db5407c9b760f3939d4 --- shell/ev-window.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/shell/ev-window.c b/shell/ev-window.c index 09e370b6..b52c32ba 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -1749,7 +1749,8 @@ ev_window_load_job_cb (EvJob *job, break; } - if (ev_window->priv->search_string && EV_IS_DOCUMENT_FIND (document)) { + 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); @@ -2285,7 +2286,8 @@ ev_window_open_document (EvWindow *ev_window, break; } - if (search_string && EV_IS_DOCUMENT_FIND (document)) { + if (search_string && EV_IS_DOCUMENT_FIND (document) && + 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), search_string); @@ -3873,12 +3875,13 @@ ev_window_cmd_edit_select_all (GtkAction *action, EvWindow *ev_window) static void ev_window_cmd_edit_find (GtkAction *action, EvWindow *ev_window) { - g_return_if_fail (EV_IS_WINDOW (ev_window)); - if (ev_window->priv->document == NULL || !EV_IS_DOCUMENT_FIND (ev_window->priv->document)) { g_error ("Find action should be insensitive since document doesn't support find"); return; - } + } + + if (EV_WINDOW_IS_PRESENTATION (ev_window)) + return; update_chrome_flag (ev_window, EV_CHROME_FINDBAR, TRUE); update_chrome_visibility (ev_window); @@ -3888,7 +3891,8 @@ ev_window_cmd_edit_find (GtkAction *action, EvWindow *ev_window) static void ev_window_cmd_edit_find_next (GtkAction *action, EvWindow *ev_window) { - g_return_if_fail (EV_IS_WINDOW (ev_window)); + if (EV_WINDOW_IS_PRESENTATION (ev_window)) + return; update_chrome_flag (ev_window, EV_CHROME_FINDBAR, TRUE); update_chrome_visibility (ev_window); @@ -3906,7 +3910,8 @@ ev_window_cmd_edit_find_next (GtkAction *action, EvWindow *ev_window) static void ev_window_cmd_edit_find_previous (GtkAction *action, EvWindow *ev_window) { - g_return_if_fail (EV_IS_WINDOW (ev_window)); + if (EV_WINDOW_IS_PRESENTATION (ev_window)) + return; update_chrome_flag (ev_window, EV_CHROME_FINDBAR, TRUE); update_chrome_visibility (ev_window); -- cgit v1.2.1