mirror of
https://github.com/0intro/wmii
synced 2024-11-22 05:42:05 +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.
|
||||
*/
|
||||
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:
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user