[evince] Change the condition for restarting search after reloading



commit a1ed5672808625582a5690156ad6261e7691807f
Author: Saurav Agarwalla <saurav agarwalla92 gmail com>
Date:   Wed Feb 19 01:15:28 2014 +0530

    Change the condition for restarting search after reloading
    
    The bug is because the relevant check condition gets the focused
    widget and it's ancestor. The problem lies in the fact that if the
    user takes away focus from the sidebar, ancestor is no longer the
    'Find' sidebar and the condition evaluates to FALSE even though it
    shouldn't. Changing the condition to check if the 'Find' sidebar is
    visible solves the problem by restarting search only when the 'Find'
    sidebar is visible.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=703595

 shell/ev-window.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 5ac0a23..c2c0f00 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -1758,8 +1758,6 @@ static void
 ev_window_reload_job_cb (EvJob    *job,
                         EvWindow *ev_window)
 {
-       GtkWidget *widget;
-
        if (ev_job_is_failed (job)) {
                ev_window_clear_reload_job (ev_window);
                ev_window->priv->in_reload = FALSE;
@@ -1779,8 +1777,7 @@ ev_window_reload_job_cb (EvJob    *job,
        }
 
        /* Restart the search after reloading */
-       widget = gtk_window_get_focus (GTK_WINDOW (ev_window));
-       if (widget && gtk_widget_get_ancestor (widget, EGG_TYPE_FIND_BAR)) {
+       if (gtk_widget_is_visible (ev_window->priv->find_bar)) {
                find_bar_search_changed_cb (EGG_FIND_BAR (ev_window->priv->find_bar),
                                            NULL, ev_window);
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]