]> git.mdlowis.com Git - projs/tide.git/commitdiff
add comment description of button actions
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 11 Jun 2019 00:51:41 +0000 (20:51 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 11 Jun 2019 00:51:41 +0000 (20:51 -0400)
src/anvil.c

index 8e27734b0591aff1b6efe617ceb085d7914587a3..f36baab1b627ce822981f89d4d117e5eebba52de 100644 (file)
@@ -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);
     }
 }