summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSachin Daluja <30343-sachindaluja@users.noreply.gitlab.gnome.org>2020-03-28 13:31:25 -0400
committerSachin Daluja <30343-sachindaluja@users.noreply.gitlab.gnome.org>2020-03-31 01:48:37 +0000
commitac1ae036962db559a4401fedb507bfec065025e1 (patch)
tree7fbfd2e73576814d292334852a82e872ad7978f1
parentba24423344f568fac6c161bdb9e3aa3e4b7408f9 (diff)
downloadnautilus-ac1ae036962db559a4401fedb507bfec065025e1.tar.gz
progress-persistence-handler: Display file transfer notification
On completion of long file transfer operation. We currently show a notification on completion of file transfer only if there are no open windows. To make Files more intuitive show all operations completed notification even if there are open windows but none of them has focus. Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/998
-rw-r--r--src/nautilus-progress-persistence-handler.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nautilus-progress-persistence-handler.c b/src/nautilus-progress-persistence-handler.c
index 77ffdcdd8..64f45e91d 100644
--- a/src/nautilus-progress-persistence-handler.c
+++ b/src/nautilus-progress-persistence-handler.c
@@ -169,22 +169,26 @@ static void
progress_info_finished_cb (NautilusProgressInfo *info,
NautilusProgressPersistenceHandler *self)
{
- GList *windows;
+ GtkWindow *last_active_window;
self->active_infos--;
- windows = nautilus_application_get_windows (self->app);
+ last_active_window = gtk_application_get_active_window (GTK_APPLICATION (self->app));
+
if (self->active_infos > 0)
{
- if (windows == NULL)
+ if (last_active_window == NULL)
{
progress_persistence_handler_update_notification (self);
}
}
- else if (windows == NULL)
+ else
{
- progress_persistence_handler_hide_notification (self);
- progress_persistence_handler_show_complete_notification (self);
+ if ((last_active_window == NULL) || !gtk_window_has_toplevel_focus (last_active_window))
+ {
+ progress_persistence_handler_hide_notification (self);
+ progress_persistence_handler_show_complete_notification (self);
+ }
}
}