Allow dragging floating clients from anywhere in their titlebars.

This commit is contained in:
Kris Maglione 2009-10-12 21:10:34 -04:00
parent ec84b73de1
commit 6bfd64e51a
2 changed files with 9 additions and 5 deletions

View File

@ -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:

View File

@ -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) {