From: Michael D. Lowis Date: Fri, 18 Jan 2019 17:11:29 +0000 (-0500) Subject: fixed a bug where debug printing in fetch was happening all the time. Reworked regist... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=6e34e47f451b1bf0e0702ba8bbce03faa168dfff;p=projs%2Ftide.git fixed a bug where debug printing in fetch was happening all the time. Reworked registrar to call XSync for all handled events --- diff --git a/src/fetch.c b/src/fetch.c index fbb1f2f..b253ee0 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -8,7 +8,6 @@ #include #include - 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; } } diff --git a/src/registrar.c b/src/registrar.c index 28bf4b3..c396d5b 100644 --- a/src/registrar.c +++ b/src/registrar.c @@ -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;