[hackers] [wmii] Fixed configurerequest function

From: Kris Maglione <jg_AT_suckless.org>
Date: Fri Feb 16 19:43:16 2007

changeset: 1890:94913be81e50
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Fri Feb 16 13:41:23 2007 -0500
summary: Fixed configurerequest function

diff -r 96c4fb7d32e9 -r 94913be81e50 client.c
--- a/client.c Thu Feb 15 22:14:39 2007 -0500
+++ b/client.c Fri Feb 16 13:41:23 2007 -0500
@@ -30,6 +30,7 @@ create_client(Window w, XWindowAttribute
         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 -r 96c4fb7d32e9 -r 94913be81e50 event.c
--- a/event.c Thu Feb 15 22:14:39 2007 -0500
+++ b/event.c Fri Feb 16 13:41:23 2007 -0500
@@ -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 -r 96c4fb7d32e9 -r 94913be81e50 fs.c
--- a/fs.c Thu Feb 15 22:14:39 2007 -0500
+++ b/fs.c Fri Feb 16 13:41:23 2007 -0500
@@ -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 -r 96c4fb7d32e9 -r 94913be81e50 printevent.c
--- a/printevent.c Thu Feb 15 22:14:39 2007 -0500
+++ b/printevent.c Fri Feb 16 13:41:23 2007 -0500
@@ -853,10 +853,15 @@ void printevent(XEvent *e)
 void printevent(XEvent *e)
 {
     XAnyEvent *ev = (void*)e;
- Client *c;
-
- if(ev->window && (c = client_of_win(ev->window)))
- printf("title=%s\n", c->name);
+ char *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) ");
Received on Fri Feb 16 2007 - 19:43:16 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:23 UTC