From: Michael D. Lowis Date: Tue, 11 Jun 2019 00:51:41 +0000 (-0400) Subject: add comment description of button actions X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=066974d7e39df4c9bfd2a1d3e39748e00d1bde03;p=projs%2Ftide.git add comment description of button actions --- 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); } }