[Xfce4-commits] [xfce/thunar] 41/46: Fix 8secs delay on logout when thunar is in daemon mode
noreply at xfce.org
noreply at xfce.org
Tue Aug 15 02:35:49 CEST 2017
This is an automated email from the git hooks/post-receive script.
a n d r e 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 b39a78a8f93e5c7dffdd76286dfefb57d70e9077
Author: acs <acs82 at gmx.de>
Date: Tue Jul 4 22:33:22 2017 +0200
Fix 8secs delay on logout when thunar is in daemon mode
---
thunar/thunar-application.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c
index e17be50..120e59d 100644
--- a/thunar/thunar-application.c
+++ b/thunar/thunar-application.c
@@ -38,6 +38,7 @@
#endif
#include <stdlib.h>
+#include <glib-unix.h>
#ifdef HAVE_GUDEV
#include <gudev/gudev.h>
@@ -114,6 +115,7 @@ static void thunar_application_set_property (GObject
static void thunar_application_startup (GApplication *application);
static void thunar_application_shutdown (GApplication *application);
static void thunar_application_activate (GApplication *application);
+static gboolean thunar_application_handle_hangup_signal (gpointer user_data);
static int thunar_application_handle_local_options (GApplication *application,
GVariantDict *options);
static int thunar_application_command_line (GApplication *application,
@@ -269,6 +271,11 @@ thunar_application_init (ThunarApplication *application)
application->progress_dialog = NULL;
application->preferences = NULL;
+#ifndef G_OS_WIN32
+ /* required in order to have no 8 second-delay on session-logout in daemon-mode */
+ g_unix_signal_add (SIGHUP, thunar_application_handle_hangup_signal, application);
+#endif
+
g_application_set_flags (G_APPLICATION (application), G_APPLICATION_HANDLES_COMMAND_LINE);
g_application_add_main_option_entries (G_APPLICATION (application), option_entries);
}
@@ -414,6 +421,16 @@ thunar_application_finalize (GObject *object)
+static gboolean
+thunar_application_handle_hangup_signal (gpointer user_data)
+{
+ ThunarApplication *application = THUNAR_APPLICATION (user_data);
+ thunar_application_set_daemon (application, FALSE);
+ return FALSE;
+}
+
+
+
static int
thunar_application_handle_local_options (GApplication *gapp,
GVariantDict *options)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list