plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit 40d787ab1276f191bcf030748a954d6708d83228
parent 9505cd15a64933bf58ec50548339cf98b1854646
Author: Russ Cox <rsc@swtch.com>
Date:   Tue, 14 Jan 2020 18:05:51 -0500

libdraw: send hangup to process when window is lost

This matches the Plan 9 behavior a bit better.

Fixes #30.

Diffstat:
Msrc/libdraw/mouse.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/libdraw/mouse.c b/src/libdraw/mouse.c @@ -52,8 +52,12 @@ _ioproc(void *arg) one = 1; resized = 0; for(;;){ - if(_displayrdmouse(mc->display, &m, &resized) < 0) + if(_displayrdmouse(mc->display, &m, &resized) < 0) { + if(postnote(PNPROC, getpid(), "hangup") < 0) + fprint(2, "postnote: %r\n"); + sleep(10*1000); threadexitsall("mouse read error"); + } if(resized) send(mc->resizec, &one); send(mc->c, &m);