i3bar: Allow child to specify signals to use

We now wait for the child process to send the first line before stopping
it to use the signal which might be specified in the i3bar protocol
header
Since clients might use the same signal for both stop and cont, we also
save the stopped state of the child to avoid stopping it while hidden!
This commit is contained in:
Quentin Glidic
2012-08-20 22:20:37 +02:00
committed by Michael Stapelberg
parent 1e114d7ab5
commit 8210c6be79
4 changed files with 47 additions and 21 deletions

View File

@ -10,6 +10,8 @@
#ifndef CHILD_H_
#define CHILD_H_
#include <stdbool.h>
#define STDIN_CHUNK_SIZE 1024
typedef struct {
@ -21,6 +23,16 @@ typedef struct {
* even an int8_t, but still…
*/
uint32_t version;
bool stopped;
/**
* The signal requested by the client to inform it of the hidden state of i3bar
*/
int stop_signal;
/**
* The signal requested by the client to inform it of theun hidden state of i3bar
*/
int cont_signal;
} i3bar_child;
/*