[dwm] checkotherwm() simplification

From: Martin Hurton <martin.hurton_AT_gmail.com>
Date: Thu, 4 Sep 2008 12:36:16 +0200

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);
 }
 
Received on Thu Sep 04 2008 - 10:36:16 UTC

This archive was generated by hypermail 2.2.0 : Thu Sep 04 2008 - 10:48:04 UTC