From: Axel Wagner Date: Wed, 25 Aug 2010 16:31:03 +0000 (+0200) Subject: Send the child SIGSTOPs and SIGCONTs X-Git-Tag: 4.0.1~7^2~72^2~4 X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3;a=commitdiff_plain;h=a83e7699e75cad515019aa1ad5f7d59ee236a918 Send the child SIGSTOPs and SIGCONTs --- diff --git a/i3bar/include/child.h b/i3bar/include/child.h index 0405816d..69cfc576 100644 --- a/i3bar/include/child.h +++ b/i3bar/include/child.h @@ -26,4 +26,16 @@ void start_child(char *command); */ void kill_child(); +/* + * Sends a SIGSTOP to the child-process (if existent) + * + */ +void stop_child(); + +/* + * Sends a SIGCONT to the child-process (if existent) + * + */ +void cont_child(); + #endif diff --git a/i3bar/src/child.c b/i3bar/src/child.c index 2b0fb780..4be5d12d 100644 --- a/i3bar/src/child.c +++ b/i3bar/src/child.c @@ -176,7 +176,7 @@ void start_child(char *command) { } /* - * kill()s the child-prozess (if existend) and closes and + * kill()s the child-process (if existent) and closes and * free()s the stdin- and sigchild-watchers * */ @@ -186,3 +186,23 @@ void kill_child() { } cleanup(); } + +/* + * Sends a SIGSTOP to the child-process (if existent) + * + */ +void stop_child() { + if (child_pid != 0) { + kill(child_pid, SIGSTOP); + } +} + +/* + * Sends a SIGCONT to the child-process (if existent) + * + */ +void cont_child() { + if (child_pid != 0) { + kill(child_pid, SIGCONT); + } +} diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index 9494b389..f5a50686 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -76,6 +76,7 @@ void hide_bars() { SLIST_FOREACH(walk, outputs, slist) { xcb_unmap_window(xcb_connection, walk->bar); } + stop_child(); } /* @@ -89,6 +90,8 @@ void unhide_bars() { uint32_t mask; uint32_t values[4]; + cont_child(); + SLIST_FOREACH(walk, outputs, slist) { if (walk->bar == XCB_NONE) { continue;