]> git.mdlowis.com Git - projs/tide.git/commitdiff
fixed tide bugs on drawing when window is too small
authorMichael D. Lowis <mike@mdlowis.com>
Sat, 17 Aug 2019 02:47:30 +0000 (22:47 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Sat, 17 Aug 2019 02:47:30 +0000 (22:47 -0400)
Rsconscript
src/anvil.c
src/tide.c

index 670f7e1be9962e967ed9ac75898c9a5cbb82c73b..6ce25f41abe3108a4d6ac4cf168623dd0afc22c7 100644 (file)
@@ -6,6 +6,7 @@ end
 build do
   env = Environment.new
   env["CC"] = "./acc"
+  env["CFLAGS"] << "-g"
   env["CPPPATH"] += %w[. inc /usr/X11/include]
   env["LIBPATH"] += %w[. /usr/X11/lib]
 
@@ -21,4 +22,7 @@ build do
   env.Command("", "tests/libedit",
     "CMD" => ["${_SOURCES}"],
     "CMD_DESC" => "TEST")
-end
\ No newline at end of file
+  env.depends("${prefix}/bin", "")
+  # Install the compiled binaries
+  Dir.glob("bin/*").each{|bin| env.Install("${prefix}/bin", bin) }
+end
index f9364a51051cc7547ddbca9b584a06cae8ab79ee..1cb4912831d9d643667ee87e8fe3aefbd4065e6d 100644 (file)
@@ -32,8 +32,6 @@ typedef struct Node {
 
 typedef void* (*Reducer)(Node* node, void* accum);
 
-typedef void (*Iterator)(Node* node);
-
 typedef struct Client {
     Node mnode, tnode;
     Window win;
@@ -49,7 +47,7 @@ typedef struct {
 } GrowState;
 
 typedef struct Column {
-    struct Column *next;
+    struct Columnnext;
     struct Client* clients;
     int flags, x, w;
 } Column;
@@ -120,12 +118,6 @@ void* list_reduce(Node* list, Reducer rfn, void* accum) {
     return (list ? list_reduce(list->next, rfn, rfn(list, accum)) : accum);
 }
 
-void list_each(Node* list, Iterator ifn) {
-    if (!list) return;
-    ifn(list);
-    list_each(list->next, ifn);
-}
-
 size_t list_count(Node* curr) {
     size_t nclients = 0;
     for (; curr; curr = curr->next, nclients++);
index 4f19478fb5cb8ac0ae8a5cb3617af458e58e815d..41349bfbcf741a66b9a02a9d908aac7b831c64ce 100644 (file)
@@ -186,11 +186,17 @@ void xresize(XConf* x, XEvent* e) {
 static void xredraw(XConf* x) {
     /* force update the title */
     win_title(NULL);
+
+    /* determine draw height such that we can draw both regions */
+    int height = x->tagfont->height * 2 + 7;
+    if (height < x->height) height = x->height;
+
     /* determine the size of the regions */
-    size_t maxtagrows = ((x->height/4) / x->tagfont->height);
+    size_t maxtagrows = ((height/4) / x->tagfont->height);
     size_t tagrows = view_limitrows(win_view(TAGS), maxtagrows);
     size_t tagregsz = (tagrows * x->tagfont->height) + 7;
-    size_t editrows = (x->height - tagregsz) / x->font->height ;
+    size_t editrows = (height - tagregsz) / x->font->height ;
+
     /* draw the regions to the window */
     int olddiv = Divider;
     drawcsr csr = { .w = x->width, .h = x->height };