From de2dd81306da54b0bfdd9b075dc5de90c871b9af Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 29 Apr 2021 07:58:12 +0300 Subject: Working on multiple UI roots Restore previous root after processing events. Adjusted colors of the non-focused root. --- src/ui/widget.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/ui/widget.c') diff --git a/src/ui/widget.c b/src/ui/widget.c index bb71df7c..590dbe70 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c @@ -1531,6 +1531,12 @@ void printTree_Widget(const iWidget *d) { printTree_Widget_(d, 0); } +static void printIndent_(int indent) { + for (int i = 0; i < indent; ++i) { + fwrite(" ", 2, 1, stdout); + } +} + void identify_Widget(const iWidget *d) { if (!d) { puts("[NULL}"); @@ -1538,12 +1544,10 @@ void identify_Widget(const iWidget *d) { } int indent = 0; for (const iWidget *w = d; w; w = w->parent, indent++) { - if (indent > 0) { - for (int i = 0; i < indent; ++i) { - fwrite(" ", 2, 1, stdout); - } - } + printIndent_(indent); printInfo_Widget_(w); } + printIndent_(indent); + printf("Root %d: %p\n", 1 + (d->root == get_Window()->roots[1]), d->root); fflush(stdout); } -- cgit v1.2.3