Include 'percent' in tree JSON, use C-locale when dumping, update testcase
This commit is contained in:
parent
ee45c92564
commit
a0cd3c2bab
|
@ -180,6 +180,9 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) {
|
||||||
ystr("orientation");
|
ystr("orientation");
|
||||||
y(integer, con->orientation);
|
y(integer, con->orientation);
|
||||||
|
|
||||||
|
ystr("percent");
|
||||||
|
y(double, con->percent);
|
||||||
|
|
||||||
ystr("urgent");
|
ystr("urgent");
|
||||||
y(integer, con->urgent);
|
y(integer, con->urgent);
|
||||||
|
|
||||||
|
@ -244,8 +247,10 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) {
|
||||||
}
|
}
|
||||||
|
|
||||||
IPC_HANDLER(tree) {
|
IPC_HANDLER(tree) {
|
||||||
|
setlocale(LC_NUMERIC, "C");
|
||||||
yajl_gen gen = yajl_gen_alloc(NULL, NULL);
|
yajl_gen gen = yajl_gen_alloc(NULL, NULL);
|
||||||
dump_node(gen, croot, false);
|
dump_node(gen, croot, false);
|
||||||
|
setlocale(LC_NUMERIC, "");
|
||||||
|
|
||||||
const unsigned char *payload;
|
const unsigned char *payload;
|
||||||
unsigned int length;
|
unsigned int length;
|
||||||
|
|
|
@ -368,10 +368,13 @@ static char **append_argument(char **original, char *argument) {
|
||||||
#define ystr(str) yajl_gen_string(gen, (unsigned char*)str, strlen(str))
|
#define ystr(str) yajl_gen_string(gen, (unsigned char*)str, strlen(str))
|
||||||
|
|
||||||
void store_restart_layout() {
|
void store_restart_layout() {
|
||||||
|
setlocale(LC_NUMERIC, "C");
|
||||||
yajl_gen gen = yajl_gen_alloc(NULL, NULL);
|
yajl_gen gen = yajl_gen_alloc(NULL, NULL);
|
||||||
|
|
||||||
dump_node(gen, croot, true);
|
dump_node(gen, croot, true);
|
||||||
|
|
||||||
|
setlocale(LC_NUMERIC, "");
|
||||||
|
|
||||||
const unsigned char *payload;
|
const unsigned char *payload;
|
||||||
unsigned int length;
|
unsigned int length;
|
||||||
y(get_buf, &payload, &length);
|
y(get_buf, &payload, &length);
|
||||||
|
|
|
@ -22,6 +22,7 @@ my $expected = {
|
||||||
id => ignore(),
|
id => ignore(),
|
||||||
rect => ignore(),
|
rect => ignore(),
|
||||||
window_rect => ignore(),
|
window_rect => ignore(),
|
||||||
|
percent => 0,
|
||||||
layout => 0,
|
layout => 0,
|
||||||
focus => ignore(),
|
focus => ignore(),
|
||||||
focused => 0,
|
focused => 0,
|
||||||
|
|
Loading…
Reference in New Issue