From 8d1dd038233cf946b36813c4c8508c17f4cda0fc Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 18 Aug 2018 16:58:50 +1000 Subject: 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. --- sway/debug-tree.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sway/debug-tree.c') diff --git a/sway/debug-tree.c b/sway/debug-tree.c index f3465afe..b47a403b 100644 --- a/sway/debug-tree.c +++ b/sway/debug-tree.c @@ -3,8 +3,10 @@ #include #include #include "config.h" +#include "sway/debug.h" #include "sway/input/input-manager.h" #include "sway/input/seat.h" +#include "sway/output.h" #include "sway/server.h" #include "sway/tree/container.h" #include "sway/tree/layout.h" @@ -12,6 +14,8 @@ #include "config.h" #include "pango.h" +struct sway_debug debug; + static const char *layout_to_str(enum sway_container_layout layout) { switch (layout) { case L_HORIZ: @@ -69,10 +73,8 @@ static int draw_container(cairo_t *cairo, struct sway_container *container, return height; } -bool enable_debug_tree = false; - void update_debug_tree() { - if (!enable_debug_tree) { + if (!debug.render_tree) { return; } -- cgit v1.2.3-54-g00ecf