aboutsummaryrefslogtreecommitdiffstats
path: root/transient.c
diff options
context:
space:
mode:
authorphilw <dscr@duck.com>2024-02-10 19:59:34 +0100
committerphilw <dscr@duck.com>2024-02-10 19:59:34 +0100
commit2807bbc931a63fddef7c099054b665a5ce71bee4 (patch)
treee949c87ab23f6f94aed0e7421d7a914cac6c6e0d /transient.c
downloaddwm-2807bbc931a63fddef7c099054b665a5ce71bee4.tar.gz
dwm-2807bbc931a63fddef7c099054b665a5ce71bee4.zip
Update colorscheme
Diffstat (limited to 'transient.c')
-rw-r--r--transient.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/transient.c b/transient.c
new file mode 100644
index 0000000..040adb5
--- /dev/null
+++ b/transient.c
@@ -0,0 +1,42 @@
1/* cc transient.c -o transient -lX11 */
2
3#include <stdlib.h>
4#include <unistd.h>
5#include <X11/Xlib.h>
6#include <X11/Xutil.h>
7
8int main(void) {
9 Display *d;
10 Window r, f, t = None;
11 XSizeHints h;
12 XEvent e;
13
14 d = XOpenDisplay(NULL);
15 if (!d)
16 exit(1);
17 r = DefaultRootWindow(d);
18
19 f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0);
20 h.min_width = h.max_width = h.min_height = h.max_height = 400;
21 h.flags = PMinSize | PMaxSize;
22 XSetWMNormalHints(d, f, &h);
23 XStoreName(d, f, "floating");
24 XMapWindow(d, f);
25
26 XSelectInput(d, f, ExposureMask);
27 while (1) {
28 XNextEvent(d, &e);
29
30 if (t == None) {
31 sleep(5);
32 t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0);
33 XSetTransientForHint(d, t, f);
34 XStoreName(d, t, "transient");
35 XMapWindow(d, t);
36 XSelectInput(d, t, ExposureMask);
37 }
38 }
39
40 XCloseDisplay(d);
41 exit(0);
42}