aboutsummaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorarg@10ksloc.org <unknown>2006-07-20 12:18:06 +0200
committerarg@10ksloc.org <unknown>2006-07-20 12:18:06 +0200
commitdc5d967ee61046f899b3b49daeb9268c8161844a (patch)
tree012a500412dc2c3a427a658d0f257c39de8351fb /client.c
parentfe3756c8e17f64d9b2aba93db28cb780f303f606 (diff)
downloaddwm-dc5d967ee61046f899b3b49daeb9268c8161844a.tar.gz
cleaned up code
Diffstat (limited to 'client.c')
-rw-r--r--client.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/client.c b/client.c
index c797972..889daa5 100644
--- a/client.c
+++ b/client.c
@@ -97,6 +97,7 @@ Client *
getclient(Window w)
{
Client *c;
+
for(c = clients; c; c = c->next)
if(c->win == w)
return c;
@@ -107,6 +108,7 @@ Client *
getctitle(Window w)
{
Client *c;
+
for(c = clients; c; c = c->next)
if(c->title == w)
return c;
@@ -198,8 +200,8 @@ manage(Window w, XWindowAttributes *wa)
{
int diff;
Client *c;
- XSetWindowAttributes twa;
Window trans;
+ XSetWindowAttributes twa;
c = emallocz(sizeof(Client));
c->win = w;
@@ -278,6 +280,7 @@ void
pop(Client *c)
{
Client **l;
+
for(l = &clients; *l && *l != c; l = &(*l)->next);
*l = c->next;
@@ -289,9 +292,9 @@ pop(Client *c)
void
resize(Client *c, Bool inc, Corner sticky)
{
- XConfigureEvent e;
- int right = c->x + c->w;
int bottom = c->y + c->h;
+ int right = c->x + c->w;
+ XConfigureEvent e;
if(inc) {
if(c->incw)
@@ -337,8 +340,9 @@ resize(Client *c, Bool inc, Corner sticky)
void
setsize(Client *c)
{
- XSizeHints size;
long msize;
+ XSizeHints size;
+
if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags)
size.flags = PSize;
c->flags = size.flags;
@@ -375,9 +379,9 @@ setsize(Client *c)
void
settitle(Client *c)
{
- XTextProperty name;
- int n;
char **list = NULL;
+ int n;
+ XTextProperty name;
name.nitems = 0;
c->name[0] = 0;
remember that computers suck.