From 03a48e4381481169fabfead898b951530309e2d8 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Tue, 17 Jan 2012 21:42:21 +0100 Subject: [PATCH 1/4] Check if tag exist in mouse_drag_tag after getting ptr --- src/mouse.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mouse.c b/src/mouse.c index 33037c0..a862f82 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -73,7 +73,7 @@ static struct tag* mouse_drag_tag(struct client *c, Window w) { struct barwin *b; - struct tag *t; + struct tag *t, *tt; Window rw; int d, u; @@ -83,7 +83,12 @@ mouse_drag_tag(struct client *c, Window w) if(b->win == rw && (t = (struct tag*)b->ptr) && t != c->tag) - return t; + { + /* Check if tag exist */ + TAILQ_FOREACH(tt, &c->screen->tags, next) + if(tt == t) + return t; + } return NULL; } From 9f31de15654f720eb8b658e48e8e3f30ad2cab43 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Tue, 17 Jan 2012 23:36:34 +0100 Subject: [PATCH 2/4] Fix configureevent fac_resize value (bug reported by blueyy, occured with sakura --- src/event.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/event.c b/src/event.c index 57e1ac2..8f8cb1a 100644 --- a/src/event.c +++ b/src/event.c @@ -93,15 +93,10 @@ event_configureevent(XEvent *e) if((c = client_gb_win(ev->window))) { - /* if(ev->value_mask & CWX) - c->geo.x = ev->x; - if(ev->value_mask & CWY) - c->geo.y = ev->y; */ - if(ev->value_mask & CWWidth) - _fac_resize(c, Right, (ev->width - (c->geo.w - c->border - c->border))); + _fac_resize(c, Right, ev->width - c->wgeo.w); if(ev->value_mask & CWHeight) - _fac_resize(c, Bottom, (ev->height - (c->geo.h - c->tbarw))); + _fac_resize(c, Bottom, ev->height - c->wgeo.h); client_apply_tgeo(c->tag); } From d26e1e8e5535268f790decec69f9b53a864cc53f Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Wed, 18 Jan 2012 00:45:31 +0100 Subject: [PATCH 3/4] Init t at null in mouse_move --- src/mouse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mouse.c b/src/mouse.c index a862f82..07cc1cc 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -98,7 +98,7 @@ void mouse_move(struct client *c, bool type) { struct client *c2 = NULL, *last = c; - struct tag *t; + struct tag *t = NULL; XEvent ev; Window w; int d, u; From 1e4aa46e462c7bd91a50d8caaaa125868bf4ee43 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Wed, 18 Jan 2012 01:43:34 +0100 Subject: [PATCH 4/4] Set back previous code in mouse_drag_tag --- src/mouse.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/mouse.c b/src/mouse.c index 07cc1cc..8d3c5b0 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -73,7 +73,7 @@ static struct tag* mouse_drag_tag(struct client *c, Window w) { struct barwin *b; - struct tag *t, *tt; + struct tag *t = NULL; Window rw; int d, u; @@ -83,12 +83,7 @@ mouse_drag_tag(struct client *c, Window w) if(b->win == rw && (t = (struct tag*)b->ptr) && t != c->tag) - { - /* Check if tag exist */ - TAILQ_FOREACH(tt, &c->screen->tags, next) - if(tt == t) - return t; - } + return t; return NULL; }