Improve code style of mouse move and resize

This commit is contained in:
Alex Kotov 2021-11-14 00:23:46 +05:00
parent 1eee271069
commit 3c5ceda88c
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 8 additions and 2 deletions

10
dwm.c
View File

@ -1334,7 +1334,10 @@ movemouse(const Arg *arg)
ny = selmon->wy + selmon->wh - HEIGHT(c);
}
if (!c->isfloating && (abs(nx - c->x) > snap_distance || abs(ny - c->y) > snap_distance)) {
if (!c->isfloating &&
(abs(nx - c->x) > snap_distance ||
abs(ny - c->y) > snap_distance))
{
togglefloating(NULL);
}
@ -1580,7 +1583,10 @@ resizemouse(const Arg *arg)
c->mon->wy + nh >= selmon->wy &&
c->mon->wy + nh <= selmon->wy + selmon->wh)
{
if (!c->isfloating && (abs(nw - c->w) > snap_distance || abs(nh - c->h) > snap_distance)) {
if (!c->isfloating &&
(abs(nw - c->w) > snap_distance ||
abs(nh - c->h) > snap_distance))
{
togglefloating(NULL);
}
}