wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit 68c49b6068a859b9f1431bba2c8795af7ae11d56
parent c9b562034a463f31eb00e8ccf36a120c574ba22a
Author: Kris Maglione <jg@suckless.org>
Date:   Tue, 13 Feb 2007 01:20:09 -0500

Frames shouldn't snap to themselves on opaque moves


Diffstat:
area.c | 2+-
client.c | 5+++--
mouse.c | 9+++++++--
view.c | 5+++--
wmii.h | 2+-
5 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/area.c b/area.c @@ -241,7 +241,7 @@ place_client(Area *a, Client *c) { || c->size.flags & USPosition || c->size.flags & PPosition) return; - rects = rects_of_view(a->view, &num); + rects = rects_of_view(a->view, &num, nil); if(!field) { mx = screen->rect.width / 8; my = screen->rect.height / 8; diff --git a/client.c b/client.c @@ -723,8 +723,9 @@ send_client(Frame *f, char *arg, Bool swap) { if(!--j) break; goto send_area; } - }else - return Ebadvalue; + } + return Ebadvalue; + send_frame: if(!swap) { remove_frame(f); diff --git a/mouse.c b/mouse.c @@ -332,9 +332,14 @@ do_mouse_resize(Client *c, Bool grabbox, BlitzAlign align) { f = c->sel; floating = f->area->floating; origin = frect = f->rect; - rects = floating ? rects_of_view(f->area->view, &num) : nil; - snap = floating ? screen->rect.height / 66 : 0; cur = cursor[CurResize]; + if(floating) { + rects = rects_of_view(f->area->view, &num, (grabbox ? c->frame : nil)); + snap = screen->rect.height / 66; + }else{ + rects = nil; + snap = 0; + } if(align == CENTER) { if(grabbox) diff --git a/view.c b/view.c @@ -248,7 +248,7 @@ arrange_view(View *v) { } XRectangle * -rects_of_view(View *v, uint *num) { +rects_of_view(View *v, uint *num, Frame *ignore) { XRectangle *result; Frame *f; @@ -256,7 +256,8 @@ rects_of_view(View *v, uint *num) { for(f=v->area->frame; f; f=f->anext, (*num)++); result = ixp_emallocz(*num * sizeof(XRectangle)); for(f=v->area->frame; f; f=f->anext) - *result++ = f->rect; + if(f != ignore) + *result++ = f->rect; *result++ = screen->rect; *result++ = screen->brect; return result - *num; diff --git a/wmii.h b/wmii.h @@ -400,7 +400,7 @@ extern View *get_view(const char *name); extern View *create_view(const char *name); extern void focus_view(WMScreen *s, View *v); extern void update_client_views(Client *c, char **tags); -extern XRectangle *rects_of_view(View *v, uint *num); +extern XRectangle *rects_of_view(View *v, uint *num, Frame *ignore); extern View *view_of_id(ushort id); extern void select_view(const char *arg); extern void attach_to_view(View *v, Frame *f);