From e53f4f0a11126139c8f6ee700204fc3769b604d2 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 16 Feb 2007 13:41:23 -0500 Subject: [PATCH] Fixed configurerequest function --- client.c | 1 + event.c | 11 +++++++++-- fs.c | 2 +- printevent.c | 11 ++++++++--- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/client.c b/client.c index 12b002d4..47654391 100644 --- a/client.c +++ b/client.c @@ -30,6 +30,7 @@ create_client(Window w, XWindowAttributes *wa) { c->rect.height = wa->height; c->proto = win_proto(c->win); update_client_name(c); + gravitate_client(c, False); c->fixedsize = False; XGetTransientForHint(blz.dpy, c->win, &c->trans); diff --git a/event.c b/event.c index 3d7b0a6a..dd3d4936 100644 --- a/event.c +++ b/event.c @@ -96,6 +96,9 @@ configurerequest(XEvent *e) { if(c) { f = c->sel; + if(verbose) + fprintf(stderr, "Configure: %s\n\ta: x=%d y=%d w=%d h=%d\n", + c->name, c->rect.x, c->rect.y, c->rect.width, c->rect.height); gravitate_client(c, True); if(ev->value_mask & CWX) c->rect.x = ev->x; @@ -108,6 +111,9 @@ configurerequest(XEvent *e) { if(ev->value_mask & CWBorderWidth) c->border = ev->border_width; gravitate_client(c, False); + if(verbose) + fprintf(stderr, "\tb: x=%d y=%d w=%d h=%d\n", + c->rect.x, c->rect.y, c->rect.width, c->rect.height); if(c->sel->area->floating) frect=&c->sel->rect; @@ -115,8 +121,8 @@ configurerequest(XEvent *e) { frect=&c->sel->revert; *frect = c->rect; - frect->y = -labelh(&def.font); - frect->x = -def.border; + frect->y -= labelh(&def.font); + frect->x -= def.border; frect->width += 2 * def.border; frect->height += frame_delta_h(); c->rect = f->crect; @@ -133,6 +139,7 @@ configurerequest(XEvent *e) { wc.border_width = ev->border_width; wc.sibling = ev->above; wc.stack_mode = ev->detail; + ev->value_mask &= ~(CWStackMode|CWSibling); XConfigureWindow(blz.dpy, ev->window, ev->value_mask, &wc); XSync(blz.dpy, False); } diff --git a/fs.c b/fs.c index 134a16a9..c42a849d 100644 --- a/fs.c +++ b/fs.c @@ -241,7 +241,7 @@ message_root(char *message) fprintf(stderr, "wmiiwm: warning: selcolors have been removed\n"); return Ebadcmd; }else if(!strncmp(message, "focuscolors ", 12)) { - message += 10; + message += 12; n = strlen(message); return parse_colors(&message, (int *)&n, &def.focuscolor); } diff --git a/printevent.c b/printevent.c index 69ece087..1d178349 100644 --- a/printevent.c +++ b/printevent.c @@ -853,10 +853,15 @@ char *eventtype(XEvent *ev) void printevent(XEvent *e) { XAnyEvent *ev = (void*)e; - Client *c; + char *name; - if(ev->window && (c = client_of_win(ev->window))) - printf("title=%s\n", c->name); + if(ev->window) { + XFetchName(blz.dpy, ev->window, &name); + if(name) { + printf("\ttitle=%s\n", name); + XFree(name); + } + } printf("%3ld %-20s ", ev->serial, eventtype(e)); if(ev->send_event) printf("(sendevent) ");