[hackers] [lsw] added new <xid> argument || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Sat, 17 Apr 2010 14:16:42 +0000 (UTC)

changeset: 4:f2df1f259f88
tag: tip
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Sat Apr 17 14:15:28 2010 +0000
files: lsw.c
description:
added new <xid> argument

diff -r 3dc58ef90490 -r f2df1f259f88 lsw.c
--- a/lsw.c Tue Oct 17 09:30:06 2006 +0200
+++ b/lsw.c Sat Apr 17 14:15:28 2010 +0000
@@ -11,7 +11,6 @@
 static char buf[1024];
 static Atom netwmname;
 static Display *dpy;
-static Window root;
 
 static void
 getname(Window w) {
@@ -44,6 +43,7 @@
         unsigned int i, num;
         Window *wins, d1, d2;
         XWindowAttributes wa;
+ Window win;
 
         if((argc > 1) && !strncmp(argv[1], "-v", 3)) {
                 fputs("lsw-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout);
@@ -53,9 +53,13 @@
                 fputs("lsw: cannot open display\n", stderr);
                 exit(EXIT_FAILURE);
         }
- root = RootWindow(dpy, DefaultScreen(dpy));
+ if(argc == 2)
+ win = atoi(argv[1]);
+ else
+ win = DefaultRootWindow(dpy);
+
         netwmname = XInternAtom(dpy, "_NET_WM_NAME", False);
- if(XQueryTree(dpy, root, &d1, &d2, &wins, &num)) {
+ if(XQueryTree(dpy, win, &d1, &d2, &wins, &num)) {
                 for(i = 0; i < num; i++) {
                         if(!XGetWindowAttributes(dpy, wins[i], &wa))
                                 continue;
Received on Sat Apr 17 2010 - 14:16:42 UTC

This archive was generated by hypermail 2.2.0 : Sat Apr 17 2010 - 14:24:04 UTC