reparenting works.

This commit is contained in:
Enno Boland (tox) 2009-09-08 07:34:15 +02:00
parent b8139e44db
commit 9bd43db63a

View file

@ -83,6 +83,7 @@ static void run(void);
static void setup(void);
static int textnw(const char *text, unsigned int len);
static void updatenumlockmask(void);
static int xerror(Display *dpy, XErrorEvent *ee);
/* variables */
static int screen;
@ -261,8 +262,9 @@ spawntab(const Arg *arg) {
}
void
reparent(Window win) {
puts("reparent window");
reparent(Window w) {
XSync(dpy, False);
XReparentWindow(dpy, w, win, 0, 0);
}
void
@ -361,6 +363,7 @@ setup(void) {
ButtonPressMask|ExposureMask|KeyPressMask|
LeaveWindowMask);
XMapRaised(dpy, win);
XSetErrorHandler(xerror);
}
int
@ -394,6 +397,18 @@ updatenumlockmask(void) {
XFreeModifiermap(modmap);
}
/* There's no way to check accesses to destroyed windows, thus those cases are
* ignored (especially on UnmapNotify's). Other types of errors call Xlibs
* default error handler, which may call exit. */
int
xerror(Display *dpy, XErrorEvent *ee) {
if(ee->error_code == BadWindow)
return 0;
die("dwm: fatal error: request code=%d, error code=%d\n",
ee->request_code, ee->error_code);
return 1;
}
int
main(int argc, char *argv[]) {
if(argc == 2 && !strcmp("-v", argv[1]))