💾 Archived View for gemini.rmf-dev.com › repo › Vaati › fdwm › files › 040adb5b3c94d5838689d28f7714e… captured on 2023-04-19 at 23:43:06. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
0 /* cc transient.c -o transient -lX11 */
1
2 #include <stdlib.h>
3 #include <unistd.h>
4 #include <X11/Xlib.h>
5 #include <X11/Xutil.h>
6
7 int main(void) {
8 Display *d;
9 Window r, f, t = None;
10 XSizeHints h;
11 XEvent e;
12
13 d = XOpenDisplay(NULL);
14 if (!d)
15 exit(1);
16 r = DefaultRootWindow(d);
17
18 f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0);
19 h.min_width = h.max_width = h.min_height = h.max_height = 400;
20 h.flags = PMinSize | PMaxSize;
21 XSetWMNormalHints(d, f, &h);
22 XStoreName(d, f, "floating");
23 XMapWindow(d, f);
24
25 XSelectInput(d, f, ExposureMask);
26 while (1) {
27 XNextEvent(d, &e);
28
29 if (t == None) {
30 sleep(5);
31 t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0);
32 XSetTransientForHint(d, t, f);
33 XStoreName(d, t, "transient");
34 XMapWindow(d, t);
35 XSelectInput(d, t, ExposureMask);
36 }
37 }
38
39 XCloseDisplay(d);
40 exit(0);
41 }
42