[Xfce4-commits] [xfce/thunar] 01/01: Still 8sec delay on logout when there is an open thunar window (Bug #15008)
noreply at xfce.org
noreply at xfce.org
Sat Jan 5 19:38:46 CET 2019
This is an automated email from the git hooks/post-receive script.
a l e x p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/thunar.
commit 331cf3e5a68aa8cda52477e3cfbc84d646752088
Author: Alexander Schwinn <alexxcons at xfce.org>
Date: Sat Dec 29 19:20:40 2018 +0100
Still 8sec delay on logout when there is an open thunar window
(Bug #15008)
---
thunar/thunar-application.c | 27 +++++++++++++++++++++++++++
thunar/thunar-application.h | 2 +-
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c
index c5ea286..71a1594 100644
--- a/thunar/thunar-application.c
+++ b/thunar/thunar-application.c
@@ -1104,6 +1104,11 @@ thunar_application_quit (ThunarApplication *application)
_thunar_return_if_fail (THUNAR_IS_APPLICATION (application));
thunar_application_set_daemon(application, FALSE);
+
+ /* For some unknown reason we need to close all open thunar windows before quit */
+ /* Otherwise thunar will hangup on quit and thunar_application_shutdown will not be called */
+ thunar_application_close_all_windows (application);
+
gtk_main_quit ();
}
@@ -1154,6 +1159,28 @@ thunar_application_set_daemon (ThunarApplication *application,
/**
+ * thunar_application_close_all_windows:
+ * @application : a #ThunarApplication.
+ *
+ * Closes all #ThunarWindows currently handled by @application.
+ **/
+void
+thunar_application_close_all_windows (ThunarApplication *application)
+{
+ GList *gtk_windows, *lp;
+
+ _thunar_return_if_fail (THUNAR_IS_APPLICATION (application));
+
+ gtk_windows = gtk_application_get_windows (GTK_APPLICATION (application));
+
+ for (lp = gtk_windows; lp != NULL; lp = lp->next)
+ if (G_LIKELY (THUNAR_IS_WINDOW (lp->data)))
+ gtk_window_close (lp->data);
+}
+
+
+
+/**
* thunar_application_get_windows:
* @application : a #ThunarApplication.
*
diff --git a/thunar/thunar-application.h b/thunar/thunar-application.h
index e5b23de..547cb70 100644
--- a/thunar/thunar-application.h
+++ b/thunar/thunar-application.h
@@ -51,7 +51,7 @@ void thunar_application_set_daemon (ThunarAppli
GList *thunar_application_get_windows (ThunarApplication *application);
gboolean thunar_application_has_windows (ThunarApplication *application);
-
+void thunar_application_close_all_windows (ThunarApplication *application);
void thunar_application_take_window (ThunarApplication *application,
GtkWindow *window);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list