From 40d787ab1276f191bcf030748a954d6708d83228 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 14 Jan 2020 18:05:51 -0500 Subject: libdraw: send hangup to process when window is lost This matches the Plan 9 behavior a bit better. Fixes #30. --- src/libdraw/mouse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libdraw') 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); -- cgit v1.2.3