mirror of
https://github.com/0intro/wmii
synced 2024-11-22 13:52:17 +03:00
Allow dragging floating clients from anywhere in their titlebars.
This commit is contained in:
parent
ec84b73de1
commit
6bfd64e51a
@ -254,12 +254,13 @@ static int (*tramp[])(Frame*) = {
|
|||||||
* like the idea.
|
* like the idea.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
trampoline(int fn, Frame *f) {
|
trampoline(int fn, Frame *f, bool grabbox) {
|
||||||
|
|
||||||
while(fn > 0) {
|
while(fn > 0) {
|
||||||
resizing = fn != TFloat;
|
resizing = fn != TFloat;
|
||||||
view_update(f->view);
|
view_update(f->view);
|
||||||
warppointer(grabboxcenter(f));
|
if(grabbox)
|
||||||
|
warppointer(grabboxcenter(f));
|
||||||
//f->collapsed = false;
|
//f->collapsed = false;
|
||||||
fn = tramp[fn](f);
|
fn = tramp[fn](f);
|
||||||
}
|
}
|
||||||
@ -285,9 +286,9 @@ mouse_movegrabbox(Client *c, bool grabmod) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(f->area->floating)
|
if(f->area->floating)
|
||||||
trampoline(TFloat, f);
|
trampoline(TFloat, f, !grabmod);
|
||||||
else
|
else
|
||||||
trampoline(THCol, f);
|
trampoline(THCol, f, true);
|
||||||
|
|
||||||
if(grabmod)
|
if(grabmod)
|
||||||
warppointer(addpt(f->r.min, Pt(x * Dx(f->r),
|
warppointer(addpt(f->r.min, Pt(x * Dx(f->r),
|
||||||
@ -562,7 +563,8 @@ tfloat(Frame *f) {
|
|||||||
frect = f->r;
|
frect = f->r;
|
||||||
|
|
||||||
pt = querypointer(&scr.root);
|
pt = querypointer(&scr.root);
|
||||||
pt1 = grabboxcenter(f);
|
/* pt1 = grabboxcenter(f); */
|
||||||
|
pt1 = pt;
|
||||||
goto case_motion;
|
goto case_motion;
|
||||||
|
|
||||||
shut_up_ken:
|
shut_up_ken:
|
||||||
|
@ -601,6 +601,8 @@ mouse_checkresize(Frame *f, Point p, bool exec) {
|
|||||||
cur = quad_cursor(q);
|
cur = quad_cursor(q);
|
||||||
if(exec) mouse_resize(f->client, q, false);
|
if(exec) mouse_resize(f->client, q, false);
|
||||||
}
|
}
|
||||||
|
else if(exec && rect_haspoint_p(p, f->titlebar))
|
||||||
|
mouse_movegrabbox(f->client, true);
|
||||||
}else {
|
}else {
|
||||||
if(f->aprev && p.y <= 2
|
if(f->aprev && p.y <= 2
|
||||||
|| f->anext && r.max.y - p.y <= 2) {
|
|| f->anext && r.max.y - p.y <= 2) {
|
||||||
|
Loading…
Reference in New Issue
Block a user