mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Limit mouse resize to hints within the client; matches kbd resize
behaviour.
This commit is contained in:
parent
e1234b75b8
commit
a94254137c
@ -57,7 +57,6 @@ mousefunc_client_resize(struct client_ctx *cc, union arg *arg)
|
|||||||
XEvent ev;
|
XEvent ev;
|
||||||
Time ltime = 0;
|
Time ltime = 0;
|
||||||
struct screen_ctx *sc = cc->sc;
|
struct screen_ctx *sc = cc->sc;
|
||||||
int x = cc->geom.x, y = cc->geom.y;
|
|
||||||
|
|
||||||
if (cc->flags & CLIENT_FREEZE)
|
if (cc->flags & CLIENT_FREEZE)
|
||||||
return;
|
return;
|
||||||
@ -81,12 +80,8 @@ mousefunc_client_resize(struct client_ctx *cc, union arg *arg)
|
|||||||
continue;
|
continue;
|
||||||
ltime = ev.xmotion.time;
|
ltime = ev.xmotion.time;
|
||||||
|
|
||||||
cc->geom.w = abs(x - ev.xmotion.x_root) - cc->bwidth;
|
cc->geom.w = ev.xmotion.x;
|
||||||
cc->geom.h = abs(y - ev.xmotion.y_root) - cc->bwidth;
|
cc->geom.h = ev.xmotion.y;
|
||||||
cc->geom.x = (x <= ev.xmotion.x_root) ?
|
|
||||||
x : x - cc->geom.w;
|
|
||||||
cc->geom.y = (y <= ev.xmotion.y_root) ?
|
|
||||||
y : y - cc->geom.h;
|
|
||||||
client_applysizehints(cc);
|
client_applysizehints(cc);
|
||||||
client_resize(cc, 1);
|
client_resize(cc, 1);
|
||||||
mousefunc_sweep_draw(cc);
|
mousefunc_sweep_draw(cc);
|
||||||
|
Loading…
Reference in New Issue
Block a user