diff options
author | Russ Cox <rsc@swtch.com> | 2020-01-14 19:43:32 -0500 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2020-01-14 19:43:32 -0500 |
commit | 1f799495e4aa89be5f32e3fcda8da342f3057f3c (patch) | |
tree | a0df34358c460fe04dff105bb20c43fd3b778b27 /src/cmd/devdraw/srv.c | |
parent | 40d787ab1276f191bcf030748a954d6708d83228 (diff) | |
download | plan9port-1f799495e4aa89be5f32e3fcda8da342f3057f3c.tar.gz plan9port-1f799495e4aa89be5f32e3fcda8da342f3057f3c.tar.bz2 plan9port-1f799495e4aa89be5f32e3fcda8da342f3057f3c.zip |
devdraw: notify window resize promptly on x11
Fixes #339.
Diffstat (limited to 'src/cmd/devdraw/srv.c')
-rw-r--r-- | src/cmd/devdraw/srv.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/cmd/devdraw/srv.c b/src/cmd/devdraw/srv.c index bfeb7c38..c98a865f 100644 --- a/src/cmd/devdraw/srv.c +++ b/src/cmd/devdraw/srv.c @@ -395,11 +395,29 @@ matchmouse(Client *c) } void +gfx_mouseresized(Client *c) +{ + gfx_mousetrack(c, -1, -1, -1, -1); +} + +void gfx_mousetrack(Client *c, int x, int y, int b, uint ms) { Mouse *m; qlock(&c->eventlk); + if(x == -1 && y == -1 && b == -1 && ms == -1) { + Mouse *copy; + // repeat last mouse event for resize + if(c->mouse.ri == 0) + copy = &c->mouse.m[nelem(c->mouse.m)-1]; + else + copy = &c->mouse.m[c->mouse.ri-1]; + x = copy->xy.x; + y = copy->xy.y; + b = copy->buttons; + ms = copy->msec; + } if(x < c->mouserect.min.x) x = c->mouserect.min.x; if(x > c->mouserect.max.x) |