From baf20a548b903bb76f94045645f9b679383bb728 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 26 Jun 2016 18:14:34 +0200 Subject: rio: move the test if w is allowed to change cursor into wsetcursor() the onscreen cursor shows the cursor of the current focused window or the window it points at. if there is no window, then we set the default cursor (nil). --- sys/src/cmd/rio/wind.c | 7 +++---- sys/src/cmd/rio/xfid.c | 6 ++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/src/cmd/rio/wind.c b/sys/src/cmd/rio/wind.c index fd86a6643..7dc9e30e2 100644 --- a/sys/src/cmd/rio/wind.c +++ b/sys/src/cmd/rio/wind.c @@ -1194,8 +1194,7 @@ wctlmesg(Window *w, int m, Rectangle r, void *p) case Holdoff: if(w->i==nil) break; - if(w==input) - wsetcursor(w, FALSE); + wsetcursor(w, FALSE); wrepaint(w); flushimage(display, 1); break; @@ -1295,9 +1294,9 @@ wsetcursor(Window *w, int force) { Cursor *p; - if(menuing || sweeping) + if(menuing || sweeping || (w!=input && wpointto(mouse->xy)!=w)) return; - if(w==nil || Dx(w->screenr)<=0 || wpointto(mouse->xy)!=w) + if(w==nil) p = nil; else { p = w->cursorp; diff --git a/sys/src/cmd/rio/xfid.c b/sys/src/cmd/rio/xfid.c index 47100a5e2..f0bd5a488 100644 --- a/sys/src/cmd/rio/xfid.c +++ b/sys/src/cmd/rio/xfid.c @@ -333,8 +333,7 @@ xfidclose(Xfid *x) break; case Qcursor: w->cursorp = nil; - if(w==input) - wsetcursor(w, FALSE); + wsetcursor(w, FALSE); break; case Qkbd: w->kbdopen = FALSE; @@ -479,8 +478,7 @@ xfidwrite(Xfid *x) memmove(w->cursor.clr, x->data+2*4, 2*2*16); w->cursorp = &w->cursor; } - if(w==input) - wsetcursor(w, TRUE); + wsetcursor(w, TRUE); break; case Qlabel: -- cgit v1.2.3