wmii

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

commit 6bfd64e51a9b76611f5ddbf9ffcad46af1b848b6
parent ec84b73de148bef50d76996356ac7cc7f676fa85
Author: Kris Maglione <jg@suckless.org>
Date:   Mon, 12 Oct 2009 21:10:34 -0400

Allow dragging floating clients from anywhere in their titlebars.

Diffstat:
cmd/wmii/layout.c | 12+++++++-----
cmd/wmii/mouse.c | 2++
2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/cmd/wmii/layout.c b/cmd/wmii/layout.c @@ -254,12 +254,13 @@ static int (*tramp[])(Frame*) = { * like the idea. */ static void -trampoline(int fn, Frame *f) { +trampoline(int fn, Frame *f, bool grabbox) { while(fn > 0) { resizing = fn != TFloat; view_update(f->view); - warppointer(grabboxcenter(f)); + if(grabbox) + warppointer(grabboxcenter(f)); //f->collapsed = false; fn = tramp[fn](f); } @@ -285,9 +286,9 @@ mouse_movegrabbox(Client *c, bool grabmod) { } if(f->area->floating) - trampoline(TFloat, f); + trampoline(TFloat, f, !grabmod); else - trampoline(THCol, f); + trampoline(THCol, f, true); if(grabmod) warppointer(addpt(f->r.min, Pt(x * Dx(f->r), @@ -562,7 +563,8 @@ tfloat(Frame *f) { frect = f->r; pt = querypointer(&scr.root); - pt1 = grabboxcenter(f); + /* pt1 = grabboxcenter(f); */ + pt1 = pt; goto case_motion; shut_up_ken: diff --git a/cmd/wmii/mouse.c b/cmd/wmii/mouse.c @@ -601,6 +601,8 @@ mouse_checkresize(Frame *f, Point p, bool exec) { cur = quad_cursor(q); if(exec) mouse_resize(f->client, q, false); } + else if(exec && rect_haspoint_p(p, f->titlebar)) + mouse_movegrabbox(f->client, true); }else { if(f->aprev && p.y <= 2 || f->anext && r.max.y - p.y <= 2) {