From f2945155edc17c8a486c04fa9a1bd199090266a6 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Thu, 9 Apr 2020 20:24:59 -0400 Subject: [PATCH] disabled debug output --- anvil.c | 34 ++++++++++++++-------------------- client.c | 8 +------- mons.c | 2 -- mouse.c | 1 - util.c | 1 - 5 files changed, 15 insertions(+), 31 deletions(-) diff --git a/anvil.c b/anvil.c index f5fb6eb..f689f66 100644 --- a/anvil.c +++ b/anvil.c @@ -17,7 +17,7 @@ static void xbtnpress(XEvent* e) XGrabPointer(X.disp, ev->window, False, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, GrabModeAsync, None, X.csr_move, CurrentTime); - printf("BTN_DN(w: 0x%lx s: %d x: %d y: %d rx: %d ry: %d)\n", ev->window, ev->state, ev->x, ev->y, ev->x_root, ev->y_root); + //printf("BTN_DN(w: 0x%lx s: %d x: %d y: %d rx: %d ry: %d)\n", ev->window, ev->state, ev->x, ev->y, ev->x_root, ev->y_root); X.start_x = ev->x_root, X.start_y = ev->y_root; X.last_x = ev->x_root, X.last_y = ev->y_root; Location loc = {0}; @@ -51,7 +51,7 @@ static void xbtnpress(XEvent* e) static void xbtnrelease(XEvent* e) { XButtonEvent* ev = &(e->xbutton); - printf("BTN_UP(w: 0x%lx x: %d y: %d rx: %d ry: %d)\n", ev->window, ev->x, ev->y, ev->x_root, ev->y_root); + //printf("BTN_UP(w: 0x%lx x: %d y: %d rx: %d ry: %d)\n", ev->window, ev->x, ev->y, ev->x_root, ev->y_root); Location loc = {0}; if (mons_find(ev->window, &loc) && (loc.client->frame == ev->window)) { @@ -65,7 +65,7 @@ static void xbtnmotion(XEvent* e) { /* make sure we get just the latest event */ XMotionEvent *ev = &e->xmotion; - printf("BTN_MV(w: 0x%lx x: %d y: %d rx: %d ry: %d)\n", ev->window, ev->x, ev->y, ev->x_root, ev->y_root); + //printf("BTN_MV(w: 0x%lx x: %d y: %d rx: %d ry: %d)\n", ev->window, ev->x, ev->y, ev->x_root, ev->y_root); while (XCheckTypedWindowEvent(X.disp, ev->window, ev->type, e)); Location loc = {0}; if (mons_find(ev->window, &loc) && (loc.client->frame == ev->window)) @@ -78,7 +78,7 @@ static void xbtnmotion(XEvent* e) static void xconfigrequest(XEvent* e) { XConfigureRequestEvent* ev = &(e->xconfigurerequest); - printf("CONF(w: 0x%lx x: %d y: %d w: %d h: %d)\n", ev->window, ev->x, ev->y, ev->width, ev->height); + //printf("CONF(w: 0x%lx x: %d y: %d w: %d h: %d)\n", ev->window, ev->x, ev->y, ev->width, ev->height); XWindowChanges wc; wc.x = ev->x; wc.y = ev->y; @@ -111,7 +111,7 @@ static void xconfigrequest(XEvent* e) static void xmaprequest(XEvent* e) { XMapRequestEvent* ev = &(e->xmaprequest); - printf("MAP(w: 0x%lx)\n", ev->window); + //printf("MAP(w: 0x%lx)\n", ev->window); XWindowAttributes attr; Location loc = {0}; if (!mons_find(ev->window, &loc)) @@ -126,7 +126,7 @@ static void xmaprequest(XEvent* e) static void xunmapnotify(XEvent* e) { XUnmapEvent* ev = &(e->xunmap); - printf("UNMAP(e: 0x%lx w: 0x%lx %d)\n", ev->event, ev->window, ev->from_configure); + //printf("UNMAP(e: 0x%lx w: 0x%lx %d)\n", ev->event, ev->window, ev->from_configure); Location loc = {0}; if (mons_find(ev->window, &loc))// && loc.client->win == ev->window) { @@ -144,7 +144,7 @@ static void xunmapnotify(XEvent* e) static void xdestroynotify(XEvent* e) { XDestroyWindowEvent* ev = &(e->xdestroywindow); - printf("DESTROY(w: 0x%lx)\n", ev->window); + //printf("DESTROY(w: 0x%lx)\n", ev->window); Location loc = {0}; if (mons_find(ev->window, &loc)) { @@ -155,7 +155,7 @@ static void xdestroynotify(XEvent* e) static void xclientmsg(XEvent* e) { XClientMessageEvent* ev = &(e->xclient); - printf("CLIENT_MSG(w: 0x%lx a: '%s')\n", ev->window, XGetAtomName(X.disp, ev->message_type)); + //printf("CLIENT_MSG(w: 0x%lx a: '%s')\n", ev->window, XGetAtomName(X.disp, ev->message_type)); if (ev->message_type == atom("_NET_ACTIVE_WINDOW")) { mons_activate(ev->window); @@ -165,7 +165,7 @@ static void xclientmsg(XEvent* e) static void xpropnotify(XEvent* e) { XPropertyEvent* ev = &(e->xproperty); - printf("PROP_NOTIFY(w: 0x%lx)\n", ev->window); + //printf("PROP_NOTIFY(w: 0x%lx)\n", ev->window); Location loc = {0}; if (mons_find(ev->window, &loc)) { @@ -178,17 +178,10 @@ static void xenternotify(XEvent* e) { XCrossingEvent* ev = &(e->xcrossing); Location loc = {0}; + //printf("ENTER(w: 0x%lx s: %d m: %d d: %d)\n", ev->window, ev->state, ev->mode, ev->detail); if (mons_find(ev->window, &loc)) { - printf("ENTER(w: 0x%lx c: 0x%lx s: %d m: %d d: %d)\n", ev->window, loc.client->win, ev->state, ev->mode, ev->detail); - if (!ev->state && !ev->mode) - { - client_focus(loc.client); - } - else - { - //XSetInputFocus(X.disp, loc.client->frame, RevertToPointerRoot, CurrentTime); - } + client_focus(loc.client); } } @@ -197,7 +190,7 @@ static void xexpose(XEvent* e) XExposeEvent* ev = &(e->xexpose); if (ev->count == 0) { - printf("EXPOSE(w: 0x%lx)\n", ev->window); + //printf("EXPOSE(w: 0x%lx)\n", ev->window); Location loc = {0}; if (mons_find(ev->window, &loc)) { @@ -209,7 +202,7 @@ static void xexpose(XEvent* e) static void xkeypress(XEvent* e) { XKeyEvent* ev = &(e->xkey); - printf("KEY_DN(w: 0x%lx)\n", ev->window); + //printf("KEY_DN(w: 0x%lx)\n", ev->window); keys_run(ev); } @@ -286,6 +279,7 @@ int main(void) { X.eventfns[ev.type](&ev); } + XSync(X.disp, False); } return 0; diff --git a/client.c b/client.c index 87e0fa3..09aba48 100644 --- a/client.c +++ b/client.c @@ -23,7 +23,6 @@ void client_initall(void) Client* client_add(Window win, XWindowAttributes* attr) { - printf("ADD(w: %lx)\n", win); Client* c = ecalloc(1, sizeof(Client)); c->win = win; c->x = attr->x; @@ -49,9 +48,7 @@ Client* client_add(Window win, XWindowAttributes* attr) XAddToSaveSet(X.disp, c->win); mons_addclient(c); client_show(c, 1); - XSync(X.disp, False); client_draw(c); - printf("PLACE(w: %lx x: %d y: %d w: %d h: %d)\n", win, c->x, c->y, c->w, c->y); return c; } @@ -64,8 +61,8 @@ void client_draw(Client* c) XSetWindowBorder(X.disp, c->frame, X.clr_bdr); XSetWindowBorderWidth(X.disp, c->win, 1); XSetWindowBorder(X.disp, c->win, X.clr_bdr); - XClearWindow(X.disp, c->frame); XDefineCursor(X.disp, c->frame, X.csr_point); + XClearWindow(X.disp, c->frame); if (c->name) { int ascent = abs(X.font_ext->max_logical_extent.y); Xutf8DrawString(X.disp, c->frame, X.font, @@ -85,7 +82,6 @@ void client_adjust(Client* c) if (c->w < minheight) c->w = minheight; if (c->h < minheight) c->h = minheight; XMoveResizeWindow(X.disp, c->frame, c->x, c->y, c->w, (shaded ? minheight : c->h)); - printf("CONFIG(c: %lx x: %d y: %d w: %d h: %d)\n", c->frame, c->x, c->y, c->w, c->h); if ( !(c->flags & F_SHADED) ) { int child_w = c->w - 2*BORDER_WIDTH - 2; @@ -125,7 +121,6 @@ void client_close(Client* c) void client_focus(Client* c) { - printf("SET_FOCUS(w: 0x%lx c: 0x%lx)\n", c->frame, c->win); Client* prev = Focused; Focused = c; XSetInputFocus(X.disp, c->win, RevertToPointerRoot, CurrentTime); @@ -134,7 +129,6 @@ void client_focus(Client* c) { client_draw(prev); } - XSync(X.disp, False); } void client_show(Client* c, int show) diff --git a/mons.c b/mons.c index 6870c41..9220487 100644 --- a/mons.c +++ b/mons.c @@ -84,7 +84,6 @@ void mons_layer(Monitor* mon) if (nwins) { XRestackWindows(X.disp, wins, nwins); - XSync(X.disp, False); } xfree(wins); } @@ -420,7 +419,6 @@ static void client_visibility(Workspace* wspace, int show) client_show(client, show); } } - XSync(X.disp, False); } static Client* client_find(Client* clients, Window win) diff --git a/mouse.c b/mouse.c index fffdc50..b4768be 100644 --- a/mouse.c +++ b/mouse.c @@ -153,7 +153,6 @@ static void float_drag(XMotionEvent* ev, Location* loc) { client_resize(loc->client, ev->x_root - X.last_x, ev->y_root - X.last_y); } - XSync(X.disp, False); } } diff --git a/util.c b/util.c index 7bf4227..af4eba7 100644 --- a/util.c +++ b/util.c @@ -48,5 +48,4 @@ void sendmsg(Window win, Atom proto, Atom type) ev.xclient.data.l[0] = type; ev.xclient.data.l[1] = CurrentTime; XSendEvent(X.disp, win, False, 0, &ev); - XSync(X.disp, False); } -- 2.52.0