]> git.mdlowis.com Git - projs/tide.git/commitdiff
fixed bug in titlebar redrawing code
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 14 Aug 2019 15:03:17 +0000 (11:03 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 14 Aug 2019 15:03:17 +0000 (11:03 -0400)
src/anvil.c

index e5fbe8917953ee6c320a2d58447c94617ae5a1ae..581a3cc9d9fdac834715b5d77efa104a1b1f7a81 100644 (file)
@@ -15,7 +15,7 @@
     ((x)->font->height + 3)
 
 enum {
-    TOO_SMALL = (1 << 0)
+    TOO_SMALL = (1 << 0),
 };
 
 typedef struct Client {
@@ -27,11 +27,19 @@ typedef struct Client {
     int flags, x, y, w, h;
 } Client;
 
+typedef struct Column {
+    struct Column *next;
+    struct Client* clients;
+    int flags, x, w;
+} Column;
+
 XConf X = {0};
 Client* Clients = NULL;
 Cursor Move_Cursor;
 int StartY = 0;
 
+Column* Columns = NULL;
+
 /* configuration */
 uint32_t BorderWidth = 1;
 uint32_t BorderColor = 0xFF0000;
@@ -160,11 +168,14 @@ Client* client_find(Window win) {
 
 void client_redraw(XConf* x, Client* c) {
     puts("redraw");
-    XftColor clr;
+    XftColor fgclr, bgclr;
     if (!c->name) return;
-    xftcolor(x, &clr, -1);
-    XftDrawStringUtf8(c->xft, &clr, x->font, 0, x->font->ascent, (const FcChar8*)c->name, strlen(c->name));
-    XftColorFree(x->display, x->visual, x->colormap, &clr);
+    xftcolor(x, &fgclr, -1);
+    xftcolor(x, &bgclr, BackgroundColor);
+    XftDrawRect(c->xft, &bgclr, 0, 0, c->w, BARHEIGHT(x));
+    XftDrawStringUtf8(c->xft, &fgclr, x->font, 0, x->font->ascent, (const FcChar8*)c->name, strlen(c->name));
+    XftColorFree(x->display, x->visual, x->colormap, &fgclr);
+    XftColorFree(x->display, x->visual, x->colormap, &bgclr);
 }
 
 void client_resize(XConf* x, Client* c, int dir) {