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. --- include/sway/debug.h | 19 +++++++++++-------- include/sway/server.h | 3 +-- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'include/sway') diff --git a/include/sway/debug.h b/include/sway/debug.h index 38d4eccd..5dcd9e00 100644 --- a/include/sway/debug.h +++ b/include/sway/debug.h @@ -1,15 +1,18 @@ #ifndef SWAY_DEBUG_H #define SWAY_DEBUG_H +#include -// Tree -extern bool enable_debug_tree; -void update_debug_tree(); +struct sway_debug { + bool highlight_damage; // Highlight regions of the screen being damaged + bool noatomic; // Ignore atomic layout updates + bool nodamage; // Render the full output on each frame + bool render_tree; // Render the tree overlay + bool txn_timings; // Log verbose messages about transactions + bool txn_wait; // Always wait for the timeout before applying +}; -// Damage -extern const char *damage_debug; +extern struct sway_debug debug; -// Transactions -extern int txn_timeout_ms; -extern bool txn_debug; +void update_debug_tree(); #endif diff --git a/include/sway/server.h b/include/sway/server.h index b93584b6..1e20f2c8 100644 --- a/include/sway/server.h +++ b/include/sway/server.h @@ -54,8 +54,7 @@ struct sway_server { struct wl_listener server_decoration; struct wl_list decorations; // sway_server_decoration::link - bool debug_txn_timings; - + size_t txn_timeout_ms; list_t *transactions; list_t *dirty_containers; }; -- cgit v1.2.3-54-g00ecf