summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2021-04-25 12:41:20 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2021-04-25 12:41:20 +0200
commit6b4b8e405ae17d5004085df03d166cddcc99c11b (patch)
tree674eb5caf887034a3c359f4117c031472893a69e
parente0cf0261d0f81eb1c54c4d4a7636c27de4b00d36 (diff)
downloadplan9front-6b4b8e405ae17d5004085df03d166cddcc99c11b.tar.xz
rio: avoid re-triggering clicks on resize/hide/unhide and send wctl when focus is lost
-rw-r--r--sys/src/cmd/rio/wind.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/src/cmd/rio/wind.c b/sys/src/cmd/rio/wind.c
index 6869cb8af..b74f8b8b2 100644
--- a/sys/src/cmd/rio/wind.c
+++ b/sys/src/cmd/rio/wind.c
@@ -378,6 +378,7 @@ wresize(Window *w, Image *i)
w->topped = ++topped;
w->resized = TRUE;
w->winnameread = FALSE;
+ w->mc.buttons = 0; /* avoid re-triggering clicks on resize */
w->mouse.counter++;
w->wctlready = 1;
}
@@ -1379,6 +1380,14 @@ wctlmesg(Window *w, int m, Rectangle r, void *p)
/* sync with input change from wcurrent()/wuncurrent() */
Channel *c = p;
input = recvp(c);
+
+ /* when we lost input, release mouse buttons */
+ if(w->mc.buttons){
+ w->mc.buttons = 0;
+ w->mouse.counter++;
+ }
+ w->wctlready = 1;
+
sendp(c, w);
}
if(w->i==nil || Dx(w->screenr)<=0)