]> git.mdlowis.com Git - projs/tide.git/commitdiff
fixed a bug where debug printing in fetch was happening all the time. Reworked regist...
authorMichael D. Lowis <mike.lowis@gentex.com>
Fri, 18 Jan 2019 17:11:29 +0000 (12:11 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Fri, 18 Jan 2019 17:11:29 +0000 (12:11 -0500)
src/fetch.c
src/registrar.c

index fbb1f2f075f87eaa5429de5c22e1e0fe71edeb87..b253ee0f61b68365c960e27af365193fb2388ec2 100644 (file)
@@ -8,7 +8,6 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
-
 typedef struct {
     enum {
         COMPLETE=0, MATCHES, IS, ISSET, ISDIR, ISFILE,
@@ -213,7 +212,8 @@ int main(int argc, char** argv) {
             if (debug)
                 printf("    %s '%s' '%s'\n", type2str(rule->type), rule->arg1, rule->arg2);
             if (!apply_rule(rule)) {
-                printf("    FAIL\n");
+                if (debug)
+                    printf("    FAIL\n");
                 break;
             }
         }
index 28bf4b323aa2193749a0a213463149cad68c314e..c396d5bd7aec9d2a963814636bf6434c85a3da6c 100644 (file)
@@ -84,7 +84,6 @@ void win_send(XConf* x, Window from, Window to, int mask, char* atom, size_t val
     ev.xclient.format = 32;
     ev.xclient.data.l[0] = val;
     XSendEvent(x->display, to, False, mask, &ev);
-    XFlush(x->display);
 }
 
 void win_open(XConf* x, Window winid, char* path, char* addr) {
@@ -113,7 +112,6 @@ void win_open(XConf* x, Window winid, char* path, char* addr) {
                 XMapRaised(x->display, win->win);
                 win_send(x, x->self, win->win, 0,  "GOTO", strtoul(addr, NULL, 0));
                 win_send(x, x->self, winid, 0,  "DONE", 0);
-                XSync(x->display, False);
                 free(type);
                 return;
             }
@@ -125,7 +123,8 @@ void win_open(XConf* x, Window winid, char* path, char* addr) {
 }
 
 void selclear(XConf* x, XEvent* e) {
-    (void)x, (void)e;
+    (void)e;
+    XSync(x->display, False);
     puts("quitting");
     exit(0);
 }
@@ -137,6 +136,7 @@ void clientmsg(XConf* x, XEvent* e) {
         win_add(x, e->xclient.window);
     else if (XA_DEL == (Atom)(e->xclient.data.l[0]))
         win_del(e->xclient.window);
+    XSync(x->display, False);
 }
 
 void propnotify(XConf* x, XEvent* e) {
@@ -156,6 +156,8 @@ void propnotify(XConf* x, XEvent* e) {
         if(file) XFree(file);
         if(addr) XFree(addr);
     }
+    XSync(x->display, False);
+
     /* cleanup any invalid windows */
 //    TWindow* wins = Windows;
 //    Windows = NULL;