diff options
author | Russ Cox <rsc@swtch.com> | 2020-01-14 18:05:51 -0500 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2020-01-14 18:05:51 -0500 |
commit | 40d787ab1276f191bcf030748a954d6708d83228 (patch) | |
tree | 717dfe6329b9b5d62beaa5e7f183733698d31db6 /src | |
parent | 9505cd15a64933bf58ec50548339cf98b1854646 (diff) | |
download | plan9port-40d787ab1276f191bcf030748a954d6708d83228.tar.gz plan9port-40d787ab1276f191bcf030748a954d6708d83228.tar.bz2 plan9port-40d787ab1276f191bcf030748a954d6708d83228.zip |
libdraw: send hangup to process when window is lost
This matches the Plan 9 behavior a bit better.
Fixes #30.
Diffstat (limited to 'src')
-rw-r--r-- | src/libdraw/mouse.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libdraw/mouse.c b/src/libdraw/mouse.c index 64a7f73d..382efae5 100644 --- 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); |