[evince] shell: Reset window title when cancelling password dialog



commit ef45e4d1322c3d5b7c40f799b02a9bc614c143c9
Author: Gary Li <gary li1 uwaterloo ca>
Date:   Wed Mar 2 18:11:55 2022 +0000

    shell: Reset window title when cancelling password dialog
    
    Currently we do not reset the Header bar title when the user
    backs off from the password dialog in the recent documents view.
    
    When a password protected file is opened, and its password
    dialog cancelled, the header bar title remain as
    "Password Required", and the filename is not updated, despite
    being back to the recent documents view.
    
    To fix this, we set the proper window title (Recent type) when
    we cancel the password dialog, and set the title of the header
    bar when the window type is Recent (done whenever the window
    title is updated).
    
    Fixes #931

 shell/ev-window-title.c | 1 +
 shell/ev-window.c       | 1 +
 2 files changed, 2 insertions(+)
---
diff --git a/shell/ev-window-title.c b/shell/ev-window-title.c
index 739eed4e6..a2fbd1159 100644
--- a/shell/ev-window-title.c
+++ b/shell/ev-window-title.c
@@ -103,6 +103,7 @@ ev_window_title_update (EvWindowTitle *window_title)
        gboolean ltr;
 
         if (window_title->type == EV_WINDOW_TITLE_RECENT) {
+                hdy_header_bar_set_title (toolbar, g_get_application_name ());
                 hdy_header_bar_set_subtitle (toolbar, NULL);
                 gtk_window_set_title (window, _("Recent Documents"));
                 return;
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 88d770e85..701b3c7eb 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -1837,6 +1837,7 @@ ev_window_password_view_cancelled (EvWindow *ev_window)
        if (ev_window_is_recent_view (ev_window)) {
                ev_window_clear_load_job (ev_window);
                ev_application_clear_uri (EV_APP);
+               ev_window_title_set_type (priv->title, EV_WINDOW_TITLE_RECENT);
        }
 }
 


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