tabbed

my build of tabbed
git clone git://git.ckyln.com/~cem/tabbed.git
Log | Files | Refs | README | LICENSE

commit 9bd43db63a9bf890cb6ed170796c0dc7002aae8e
parent b8139e44db0fcd6f1858e1eec00daeec93838de5
Author: Enno Boland (tox) <tox@s01.de>
Date:   Tue,  8 Sep 2009 07:34:15 +0200

reparenting works.
Diffstat:
Mtabbed.c | 19+++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/tabbed.c b/tabbed.c @@ -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]))