[Xfce4-commits] [xfce/thunar] 01/01: Followup of fix "8 second delay on logout" (Bug #13726)

noreply at xfce.org noreply at xfce.org
Fri Aug 25 08:30:57 CEST 2017


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 7db6bf8f42a435afab9dd55f84c5304e74a88377
Author: Alexander Schwinn <acs82 at gmx.de>
Date:   Mon Aug 21 22:43:28 2017 +0200

    Followup of fix "8 second delay on logout" (Bug #13726)
---
 thunar/thunar-application.c    | 34 +++++++++++++++++-----------------
 thunar/thunar-application.h    |  2 ++
 thunar/thunar-session-client.c |  4 ++--
 3 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c
index 6ea5723..afd9e6c 100644
--- a/thunar/thunar-application.c
+++ b/thunar/thunar-application.c
@@ -38,7 +38,6 @@
 #endif
 
 #include <stdlib.h>
-#include <glib-unix.h>
 
 #ifdef HAVE_GUDEV
 #include <gudev/gudev.h>
@@ -126,7 +125,6 @@ static void           thunar_application_dbus_init              (ThunarApplicati
 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,
@@ -282,11 +280,6 @@ 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);
 }
@@ -463,16 +456,6 @@ 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)
@@ -1084,6 +1067,23 @@ thunar_application_get (void)
 
 
 /**
+ * thunar_application_quit:
+ * @application : a #ThunarApplication.
+ *
+ * Attempts to exit daemon mode(required if application is on hold) and leaves the gtk main loop
+ **/
+void
+thunar_application_quit (ThunarApplication *application)
+{
+  _thunar_return_if_fail (THUNAR_IS_APPLICATION (application));
+
+  thunar_application_set_daemon(application, FALSE);
+  gtk_main_quit ();
+}
+
+
+
+/**
  * thunar_application_get_daemon:
  * @application : a #ThunarApplication.
  *
diff --git a/thunar/thunar-application.h b/thunar/thunar-application.h
index e1c6dda..b282630 100644
--- a/thunar/thunar-application.h
+++ b/thunar/thunar-application.h
@@ -42,6 +42,8 @@ GType                 thunar_application_get_type                   (void) G_GNU
 
 ThunarApplication    *thunar_application_get                        (void);
 
+void                  thunar_application_quit                       (ThunarApplication *application);
+
 gboolean              thunar_application_get_daemon                 (ThunarApplication *application);
 void                  thunar_application_set_daemon                 (ThunarApplication *application,
                                                                      gboolean           daemon);
diff --git a/thunar/thunar-session-client.c b/thunar/thunar-session-client.c
index 0347f14..1017789 100644
--- a/thunar/thunar-session-client.c
+++ b/thunar/thunar-session-client.c
@@ -338,8 +338,8 @@ thunar_session_client_die (SmcConn              connection,
   _thunar_return_if_fail (THUNAR_IS_SESSION_CLIENT (session_client));
   _thunar_return_if_fail (session_client->connection == connection);
 
-  /* terminate the application */
-  gtk_main_quit ();
+  ThunarApplication* application = thunar_application_get ();
+  thunar_application_quit (application);
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list