ANSIfy; welcome to 1989.
exit(3) needs stdlib.
Consistently use %lu for outputting Window.
GC unused var.
Use calloc() for what it's meant for.
Move the libctwm/demolib stuff into a subdir, and break out a separate
cmake config for it.
This 'gtw' is a client-ish program too.  It looks scary as crap, and I
strongly suggest not getting anywhere near running it, but hey, it
compiles (noisily, and I don't care enough to clean up the warnings
right now), so stick it in here.
This header file only has meaning in here, so move it in.
Generate a 'client' target.
Add a little bit of a Makefile here, that mostly works.

Probably not worth polishing further, as this code is all pretty much
a curiosity.  If somebody ever cares enough to really work on it, they
can work out how to make this better too.
Move these mostly-curiosity 'client'-ish programs off into a subdir,
and do minimal scaffolding to allow them to be built from there.