summaryrefslogtreecommitdiff
path: root/src/ui/widget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-29 07:58:12 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-29 07:58:12 +0300
commitde2dd81306da54b0bfdd9b075dc5de90c871b9af (patch)
tree0ebba8936496ead6e3441570a6e4e7002f2da1b4 /src/ui/widget.c
parent87b5dbd9c0393e787d2499d796486d3293f17214 (diff)
Working on multiple UI roots
Restore previous root after processing events. Adjusted colors of the non-focused root.
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r--src/ui/widget.c14
1 files changed, 9 insertions, 5 deletions
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) {
1531 printTree_Widget_(d, 0); 1531 printTree_Widget_(d, 0);
1532} 1532}
1533 1533
1534static void printIndent_(int indent) {
1535 for (int i = 0; i < indent; ++i) {
1536 fwrite(" ", 2, 1, stdout);
1537 }
1538}
1539
1534void identify_Widget(const iWidget *d) { 1540void identify_Widget(const iWidget *d) {
1535 if (!d) { 1541 if (!d) {
1536 puts("[NULL}"); 1542 puts("[NULL}");
@@ -1538,12 +1544,10 @@ void identify_Widget(const iWidget *d) {
1538 } 1544 }
1539 int indent = 0; 1545 int indent = 0;
1540 for (const iWidget *w = d; w; w = w->parent, indent++) { 1546 for (const iWidget *w = d; w; w = w->parent, indent++) {
1541 if (indent > 0) { 1547 printIndent_(indent);
1542 for (int i = 0; i < indent; ++i) {
1543 fwrite(" ", 2, 1, stdout);
1544 }
1545 }
1546 printInfo_Widget_(w); 1548 printInfo_Widget_(w);
1547 } 1549 }
1550 printIndent_(indent);
1551 printf("Root %d: %p\n", 1 + (d->root == get_Window()->roots[1]), d->root);
1548 fflush(stdout); 1552 fflush(stdout);
1549} 1553}