Hi,

The patch below changes the checkotherwm() function so that the xerrorlib
is initialised before changing the error handler, not after. Please comment.

/Martin


diff -r 8a9a1dbeff49 dwm.c
--- a/dwm.c     Tue Sep 02 22:36:06 2008 +0100
+++ b/dwm.c     Thu Sep 04 12:23:51 2008 +0200
@@ -337,15 +337,14 @@
 void
 checkotherwm(void) {
        otherwm = False;
-       XSetErrorHandler(xerrorstart);
+       xerrorxlib = XSetErrorHandler(xerrorstart);
 
        /* this causes an error if some other window manager is running */
        XSelectInput(dpy, DefaultRootWindow(dpy), SubstructureRedirectMask);
        XSync(dpy, False);
        if(otherwm)
                die("dwm: another window manager is already running\n");
-       XSetErrorHandler(NULL);
-       xerrorxlib = XSetErrorHandler(xerror);
+       XSetErrorHandler(xerror);
        XSync(dpy, False);
 }
 

Reply via email to