gboolean terminateShowDialog (Client *c) { ScreenInfo *screen_info; char *argv[4]; GError *err; int child_pid; int outpipe; GIOChannel *channel; gchar *xid; if (c->dialog_pid > 0) { return FALSE; } screen_info = c->screen_info; xid = g_strdup_printf ("0x%lx", c->window); argv[0] = HELPERDIR "/xfce4/xfwm4/helper-dialog"; argv[1] = xid; argv[2] = c->name; argv[3] = NULL; err = NULL; if (!gdk_spawn_on_screen_with_pipes (screen_info->gscr, NULL, argv, NULL, 0, NULL, NULL, &child_pid, NULL, &outpipe, NULL, &err)) { g_warning (_("Cannot spawn helper-dialog: %s\n"), err->message); g_error_free (err); g_free (xid); return FALSE; } g_free (xid); c->dialog_pid = child_pid; c->dialog_fd = outpipe; channel = g_io_channel_unix_new (c->dialog_fd); g_io_add_watch_full (channel, G_PRIORITY_DEFAULT, G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, terminateProcessIO, (gpointer) c, NULL); g_io_channel_unref (channel); return TRUE; }
static gboolean spawn_screen_spawn (GfcSpawnStrategy* self, gchar const * working_folder, gchar **argv, gchar **envv, GSpawnFlags flags, GPid * return_pid, gint * return_stdin, gint * return_stdout, gint * return_stderr, GError **return_error) { return gdk_spawn_on_screen_with_pipes (GFC_SPAWN_SCREEN (self)->_private->screen, working_folder, argv, envv, flags, NULL, NULL, return_pid, return_stdin, return_stdout, return_stderr, return_error); }