From c47aa4c4279beb700ec18c83fcf74aafc77d76a4 Mon Sep 17 00:00:00 2001 From: Bradley Taunt Date: Wed, 17 Jan 2024 19:44:16 -0500 Subject: Initial commit to cgit and place all suckless programs within installer --- dwmf/transient.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 dwmf/transient.c (limited to 'dwmf/transient.c') diff --git a/dwmf/transient.c b/dwmf/transient.c new file mode 100755 index 0000000..040adb5 --- /dev/null +++ b/dwmf/transient.c @@ -0,0 +1,42 @@ +/* cc transient.c -o transient -lX11 */ + +#include +#include +#include +#include + +int main(void) { + Display *d; + Window r, f, t = None; + XSizeHints h; + XEvent e; + + d = XOpenDisplay(NULL); + if (!d) + exit(1); + r = DefaultRootWindow(d); + + f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0); + h.min_width = h.max_width = h.min_height = h.max_height = 400; + h.flags = PMinSize | PMaxSize; + XSetWMNormalHints(d, f, &h); + XStoreName(d, f, "floating"); + XMapWindow(d, f); + + XSelectInput(d, f, ExposureMask); + while (1) { + XNextEvent(d, &e); + + if (t == None) { + sleep(5); + t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0); + XSetTransientForHint(d, t, f); + XStoreName(d, t, "transient"); + XMapWindow(d, t); + XSelectInput(d, t, ExposureMask); + } + } + + XCloseDisplay(d); + exit(0); +} -- cgit v1.2.3-54-g00ecf