From 28cacde37de17e1f471b215e55d644b53881a24b Mon Sep 17 00:00:00 2001 From: rodri Date: Sat, 16 Nov 2024 14:10:47 +0000 Subject: bts: fix confirmdone(). --- bts.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bts.c') diff --git a/bts.c b/bts.c index 8dba409..7a1d17a 100644 --- a/bts.c +++ b/bts.c @@ -708,15 +708,16 @@ confirmdone(Mousectl *mc) }; csetcursor(mc, &anchor); - readmouse(mc); - while(mc->buttons == 0) + while(mc->buttons != 0) /* ignore any buttons already pressed */ + readmouse(mc); + while(mc->buttons == 0) /* wait for a button press */ readmouse(mc); if(mc->buttons != 4){ while(nbrecv(kctl->c, nil)) /* flush key presses */ csetcursor(mc, nil); return 0; } - while(mc->buttons){ + while(mc->buttons){ /* commit action on button release */ if(mc->buttons != 4){ while(nbrecv(kctl->c, nil)); csetcursor(mc, nil); -- cgit v1.2.3