From 066974d7e39df4c9bfd2a1d3e39748e00d1bde03 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 10 Jun 2019 20:51:41 -0400 Subject: [PATCH] add comment description of button actions --- src/anvil.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/anvil.c b/src/anvil.c index 8e27734..f36baab 100644 --- a/src/anvil.c +++ b/src/anvil.c @@ -45,6 +45,16 @@ void* xfree(void* p) { /* Client Handling *****************************************************************************/ +void client_add(XConf* x, Client* c) { +} + +void client_del(XConf* x, Client* c) { + /* first remove it from the list */ + if (c->prev) c->prev->next = c->next; + if (c->next) c->next->prev = c->prev; + if (Clients == c) Clients = c->next; +} + void client_config(XConf* xs, Client* c, int x, int y, int w, int h) { c->x = x, c->y = y, c->w = w, c->h = h; int height = xs->font->height + 3; @@ -57,7 +67,7 @@ void client_raise(XConf* x, Client* c) { XMapRaised(x->display, c->win); } -void client_add(XConf* x, Window win) { +void client_create(XConf* x, Window win) { Client* c = calloc(1, sizeof(Client)); c->win = win; XGrabServer(x->display); @@ -108,13 +118,8 @@ void client_add(XConf* x, Window win) { } -void client_del(XConf* x, Client* c) { - /* first remove it from the list */ - if (c->prev) c->prev->next = c->next; - if (c->next) c->next->prev = c->prev; - if (Clients == c) Clients = c->next; - - /* clean it up now */ +void client_destroy(XConf* x, Client* c) { + client_del(x, c); XGrabServer(x->display); XftDrawDestroy(c->xft); XDestroyWindow(x->display, c->frame); @@ -186,7 +191,7 @@ static void xmaprequest(XConf* x, XEvent* e) { if (XGetWindowAttributes(x->display, e->xmaprequest.window, &attr)) { if (attr.override_redirect) return; /* ignore certain windows (like frames) */ if (!client_find(e->xmaprequest.window)) - client_add(x, e->xmaprequest.window); + client_create(x, e->xmaprequest.window); } } @@ -209,7 +214,7 @@ static void xdestroynotify(XConf* x, XEvent* e) { client_config(x, c->next, c->next->x, c->next->y, c->next->w, c->next->h); client_raise(x, c->next); } - client_del(x, c); + client_destroy(x, c); } } -- 2.55.0