diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-18 16:58:50 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-19 16:17:24 +1000 |
commit | 8d1dd038233cf946b36813c4c8508c17f4cda0fc (patch) | |
tree | e672976231d33467da6c8a03633c604eb0c8deb8 /sway/main.c | |
parent | 389d159c81502aa8b951895de11c3720bbd5ba7d (diff) |
Standardise debug variables
This makes all debug options stored in a single struct rather than in
various places, changes/fixes the behaviour of existing options, and
introduces some new options.
* Fixes damage issues with `-Drender-tree` texture (by removing scissor)
* Offsets the render tree overlay's `y` position for those who have
swaybar at the top
* Replaces `-Ddamage=rerender` with `-Dnodamage`
* Replaces `-Ddamage=highlight` with `-Dhighlight-damage`
* Replaces `-Dtxn-debug` with `-Dtxn-wait`
* Introduces `-Dnoatomic`
* Removes the `create_time` and `ms_arranging` figures from transactions
and the log message. Transactions are created after arranging and the
create time is of no significance.
* Fixes `-Dtxn-debug` (now `-Dtxn-wait`) not working.
Diffstat (limited to 'sway/main.c')
-rw-r--r-- | sway/main.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sway/main.c b/sway/main.c index 54f48340..7a1afd4c 100644 --- a/sway/main.c +++ b/sway/main.c @@ -235,14 +235,20 @@ static void drop_permissions(bool keep_caps) { } void enable_debug_flag(const char *flag) { - if (strcmp(flag, "render-tree") == 0) { - enable_debug_tree = true; - } else if (strncmp(flag, "damage=", 7) == 0) { - damage_debug = &flag[7]; - } else if (strcmp(flag, "txn-debug") == 0) { - txn_debug = true; + if (strcmp(flag, "highlight-damage") == 0) { + debug.highlight_damage = true; + } else if (strcmp(flag, "noatomic") == 0) { + debug.noatomic = true; + } else if (strcmp(flag, "nodamage") == 0) { + debug.nodamage = true; + } else if (strcmp(flag, "render-tree") == 0) { + debug.render_tree = true; + } else if (strcmp(flag, "txn-wait") == 0) { + debug.txn_wait = true; + } else if (strcmp(flag, "txn-timings") == 0) { + debug.txn_timings = true; } else if (strncmp(flag, "txn-timeout=", 12) == 0) { - txn_timeout_ms = atoi(&flag[12]); + server.txn_timeout_ms = atoi(&flag[12]); } } |