[dwm] [patch] scan()

From: Martin Hurton <martin.hurton_AT_gmail.com>
Date: Fri, 15 Aug 2008 13:49:14 +0200

The patch below makes the scan() function a little simpler.
Comments are welcome.

Cheers,
/Martin

diff -r bca7a556aa03 dwm.c
--- a/dwm.c Thu Aug 14 22:35:52 2008 +0200
+++ b/dwm.c Fri Aug 15 13:34:05 2008 +0200
@@ -1249,7 +1249,6 @@
         Window *wins, d1, d2;
         XWindowAttributes wa;
 
- wins = NULL;
         if(XQueryTree(dpy, root, &d1, &d2, &wins, &num)) {
                 for(i = 0; i < num; i++) {
                         if(!XGetWindowAttributes(dpy, wins[i], &wa)
@@ -1265,9 +1264,9 @@
                         && (wa.map_state == IsViewable || getstate(wins[i]) == IconicState))
                                 manage(wins[i], &wa);
                 }
+ if(wins)
+ XFree(wins);
         }
- if(wins)
- XFree(wins);
 }
 
 void
Received on Fri Aug 15 2008 - 11:49:14 UTC

This archive was generated by hypermail 2.2.0 : Fri Aug 15 2008 - 12:00:04 UTC