diff options
author | Joe <bousset.rudy@gmail.com> | 2022-08-09 14:47:37 +0200 |
---|---|---|
committer | Joe <bousset.rudy@gmail.com> | 2022-08-09 14:47:37 +0200 |
commit | 6d443caaa974891c107197341b3188cd46a0869c (patch) | |
tree | d0714404ec7380784703846d28a4716eb86b674e /dwm-6.3/transient.c | |
parent | 2px border (diff) | |
download | dwm-6d443caaa974891c107197341b3188cd46a0869c.tar.gz dwm-6d443caaa974891c107197341b3188cd46a0869c.tar.bz2 dwm-6d443caaa974891c107197341b3188cd46a0869c.tar.xz dwm-6d443caaa974891c107197341b3188cd46a0869c.tar.zst dwm-6d443caaa974891c107197341b3188cd46a0869c.zip |
update to 6.3 in progress
Diffstat (limited to 'dwm-6.3/transient.c')
-rw-r--r-- | dwm-6.3/transient.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/dwm-6.3/transient.c b/dwm-6.3/transient.c new file mode 100644 index 0000000..040adb5 --- /dev/null +++ b/dwm-6.3/transient.c @@ -0,0 +1,42 @@ +/* cc transient.c -o transient -lX11 */ + +#include <stdlib.h> +#include <unistd.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> + +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); +} |