diff options
| author | Thomas Ulmer <thomasmulmer02@gmail.com> | 2026-02-13 09:22:47 -0800 |
|---|---|---|
| committer | Thomas Ulmer <thomasmulmer02@gmail.com> | 2026-02-13 09:22:47 -0800 |
| commit | f56506908110a82b369780a5a7cfc07cc7ede850 (patch) | |
| tree | 3d2152dae43bc664556eff7ff5b254236b6f41b7 /tree/src/dwm/my-dwm/transient.c | |
| parent | 20867201e2016aa1f4dc489ec2f608cfcdb6aac2 (diff) | |
dwm try single tagsset
Diffstat (limited to 'tree/src/dwm/my-dwm/transient.c')
| -rw-r--r-- | tree/src/dwm/my-dwm/transient.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tree/src/dwm/my-dwm/transient.c b/tree/src/dwm/my-dwm/transient.c new file mode 100644 index 0000000..040adb5 --- /dev/null +++ b/tree/src/dwm/my-dwm/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); +} |
