about summary refs log tree commit diff stats
path: root/transient.c
blob: 040adb5b3c94d5838689d28f7714ec23297fb30a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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);
}
>B Mod1-space Toggle between tiling and floating mode (affects all windows). .TP .B Mod1-Shift-space Toggle focused window between floating and non-floating state (tiling mode only). .TP .B Mod1-[1..n] View all windows with .BR nth tag. .TP .B Mod1-0 View all windows with any tag. .TP .B Mod1-Control-[1..n] Add/remove all windows with .BR nth tag to/from the view. .TP .B Mod1-Shift-q Quit dwm. .SS Mouse commands .TP .B Mod1-Button1 Move current window while dragging (floating mode only). .TP .B Mod1-Button2 Zoom current window to the master area (tiling mode only). .TP .B Mod1-Button3 Resize current window while dragging (floating mode only). .SH CUSTOMIZATION dwm is customized by creating a custom config.h and (re)compiling the source code. This keeps it fast, secure and simple. .SH SEE ALSO .BR dmenu (1) .SH BUGS The status bar may display .BR "EOF" when dwm has been started by an X session manager like .BR xdm (1), because those close standard output before executing dwm. .P Java applications which use the XToolkit/XAWT backend may draw grey windows only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early JDK 1.6 versions, because it assumes a reparenting window manager. As a workaround you can use JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or you can set the following environment variable (to use the older Motif backend instead): .BR AWT_TOOLKIT=MToolkit .