summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2005-03-05 18:22:47 +0000
committersabetts <sabetts>2005-03-05 18:22:47 +0000
commit3df6eb689ece68c3ada07a4e266d2b695dbb23d7 (patch)
tree225f1a03c500b78687c6de328f7b0495b49d93ab /src/main.c
parent72cbc37bf8e9adc368b57e4b1dbf58cd8218eb0f (diff)
downloadratpoison-3df6eb689ece68c3ada07a4e266d2b695dbb23d7.zip
* src/ratpoison.h (check_child_procs): new prototype
(chld_handler): likewise (set_sig_handler): likewise * src/main.c (check_child_procs): new function (chld_handler): call check_child_procs (free_screen): unselect all events on the root window. * src/actions.c: include signal.h (spawn): don't prefix the command with exec. (set_wingravity): print the setting as a string. (set_transgravity): likewise (set_maxsizegravity): likewise (set_bargravity): likewise (set_font): likewise (set_winfmt): likewise (set_fgcolor): likewise (set_bgcolor): likewise (set_framesels): likewise (cmd_tmpwm): ungrab the keys for all windows before spawning the new wm. (cmd_tmpwm): disable the sigchld handler then enabled it after the wm returns. call check_child_procs.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 32f28e5..365985c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -181,14 +181,13 @@ alrm_handler (int signum)
alarm_signalled++;
}
+/* Check for child processes that have quit but haven't been
+ acknowledged yet. Update their structure. */
void
-chld_handler (int signum)
+check_child_procs ()
{
rp_child_info *cur;
- int pid, status, serrno;
-
- serrno = errno;
-
+ int pid, status;
while (1)
{
pid = waitpid (WAIT_ANY, &status, WNOHANG);
@@ -210,6 +209,15 @@ chld_handler (int signum)
chld_signalled = 1;
}
+}
+
+void
+chld_handler (int signum)
+{
+ int serrno;
+
+ serrno = errno;
+ check_child_procs();
errno = serrno;
}
@@ -681,6 +689,9 @@ free_screen (rp_screen *s)
rp_frame *frame;
struct list_head *iter, *tmp;
+ /* Relinquish our hold on the root window. */
+ XSelectInput(dpy, RootWindow (dpy, s->screen_num), 0);
+
list_for_each_safe_entry (frame, iter, tmp, &s->frames, node)
{
frame_free (s, frame);