Files
dat-thang/tests/helpers/dillo-title-probe.c
T
divorce b735900f2e 0.0.002
ddat interop with dat js
cable interop with cabal js
ddat's frontend = dat-thang
cable fe = cable-thang
dillo support based on cel's dillo-dat
bootstrap node
xplatform support

Signed-off-by: divo <418@cryspace.space>
2026-10-19 00:17:02 -04:00

25 lines
766 B
C

#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static void walk(Display *d, Window w, int depth) {
Window root, parent, *children = NULL;
unsigned int n = 0, i;
char *name = NULL;
if (XFetchName(d, w, &name) && name) {
if (strstr(name, "Dillo") || strstr(name, "Site is online")) printf("%.*s%s\n", depth * 2, " ", name);
XFree(name);
}
if (XQueryTree(d, w, &root, &parent, &children, &n)) {
for (i = 0; i < n; i++) walk(d, children[i], depth + 1);
if (children) XFree(children);
}
}
int main(void) {
Display *d = XOpenDisplay(NULL);
if (!d) { fputs("XOpenDisplay failed\n", stderr); return 1; }
walk(d, DefaultRootWindow(d), 0);
XCloseDisplay(d);
return 0;
}