3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; either version 2, or (at your option)
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License
14
along with this program; if not, write to the Free Software
15
Foundation, Inc., Inc., 51 Franklin Street, Fifth Floor, Boston,
18
metacity - (c) 2001, 2002 Havoc Pennington
19
xfwm4 - (c) 2002-2009 Olivier Fourdan
27
#include <sys/types.h>
35
terminateCloseDialog (Client *c)
37
g_return_if_fail (c != NULL);
41
kill (c->dialog_pid, SIGKILL);
44
if (c->dialog_fd >= 0)
52
terminateProcessIO (GIOChannel *channel,
53
GIOCondition condition,
62
g_return_val_if_fail (c != NULL, FALSE);
68
if (condition & G_IO_IN)
70
g_io_channel_read_to_end (channel, &str, &len, &err);
74
g_warning (_("Error reading data from child process: %s\n"), err->message);
79
if (!g_strncasecmp(str, "yes", 3))
88
terminateCloseDialog (c);
94
terminateShowDialog (Client *c)
96
ScreenInfo *screen_info;
104
if (c->dialog_pid > 0)
109
screen_info = c->screen_info;
110
xid = g_strdup_printf ("0x%lx", c->window);
112
argv[0] = LIBEXECDIR"/xfce4/xfwm4/helper-dialog";
118
if (!gdk_spawn_on_screen_with_pipes (screen_info->gscr, NULL, argv, NULL,
119
0, NULL, NULL, &child_pid, NULL, &outpipe,
122
g_warning (_("Cannot spawn helper-dialog: %s\n"), err->message);
129
c->dialog_pid = child_pid;
130
c->dialog_fd = outpipe;
132
channel = g_io_channel_unix_new (c->dialog_fd);
133
g_io_add_watch_full (channel, G_PRIORITY_DEFAULT,
134
G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
137
g_io_channel_unref (channel);