summaryrefslogtreecommitdiff
path: root/suckless/dwm/dwm-6.6/transient.c
diff options
context:
space:
mode:
authorThomas Ulmer <thomasmulmer02@gmail.com>2026-06-14 08:59:25 -0700
committerThomas Ulmer <thomasmulmer02@gmail.com>2026-06-14 08:59:25 -0700
commit3376b6420d3b6cc965890e46e7bbd06fbc9fd037 (patch)
tree67b59ce0f9ba016db62067a081c0535d064d2a3f /suckless/dwm/dwm-6.6/transient.c
parentd533343af750dcfda2321f33953b66396e767f10 (diff)
layout reorg
Diffstat (limited to 'suckless/dwm/dwm-6.6/transient.c')
-rw-r--r--suckless/dwm/dwm-6.6/transient.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/suckless/dwm/dwm-6.6/transient.c b/suckless/dwm/dwm-6.6/transient.c
new file mode 100644
index 0000000..040adb5
--- /dev/null
+++ b/suckless/dwm/dwm-6.6/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);
+}