[Xfce4-commits] [thunar-plugins/thunar-archive-plugin] 06/08: Replace gdk_spawn_on_screen by g_spawn_async

noreply at xfce.org noreply at xfce.org
Thu Nov 2 22:49:26 CET 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 thunar-plugins/thunar-archive-plugin.

commit 33c677ea3402af3bc65ed3b5a2df237ace8ac8a7
Author: Andre Miranda <andre42m at gmail.com>
Date:   Sat May 20 20:49:47 2017 -0300

    Replace gdk_spawn_on_screen by g_spawn_async
---
 thunar-archive-plugin/tap-backend.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/thunar-archive-plugin/tap-backend.c b/thunar-archive-plugin/tap-backend.c
index 5527135..f1db6fb 100644
--- a/thunar-archive-plugin/tap-backend.c
+++ b/thunar-archive-plugin/tap-backend.c
@@ -50,6 +50,7 @@ static GPid      tap_backend_run                        (const gchar *action,
                                                          GList       *content_types,
                                                          GtkWidget   *window,
                                                          GError     **error);
+static void      tap_backend_setup_display_cb           (gpointer data);
 
 
 
@@ -395,6 +396,7 @@ tap_backend_run (const gchar *action,
   GList                    *lp;
   GPid                      pid = -1;
   gint                      n;
+  gchar                    *display = NULL;
 
   /* determine the mime infos on-demand */
   if (G_LIKELY (content_types == NULL))
@@ -438,8 +440,11 @@ tap_backend_run (const gchar *action,
           /* determine the screen for this window */
           screen = gtk_widget_get_screen (window);
 
+          if (screen != NULL)
+            display = gdk_screen_make_display_name (screen);
+
           /* try to run the command */
-          if (!gdk_spawn_on_screen (screen, folder, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &pid, error))
+          if (!g_spawn_async (folder, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, tap_backend_setup_display_cb, display, &pid, error))
             pid = -1;
 
           /* cleanup */
@@ -459,6 +464,14 @@ tap_backend_run (const gchar *action,
 
 
 
+static void
+tap_backend_setup_display_cb (gpointer data)
+{
+  g_setenv ("DISPLAY", (char *) data, TRUE);
+}
+
+
+
 /**
  * tap_backend_create_archive:
  * @folder : the path to the folder in which to create the archive.
@@ -570,5 +583,3 @@ tap_backend_extract_to (const gchar *folder,
   /* run the action */
   return tap_backend_run ("extract-to", folder, files, NULL, window, error);
 }
-
-

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


More information about the Xfce4-commits mailing list