summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-06-26 18:14:34 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-06-26 18:14:34 +0200
commitbaf20a548b903bb76f94045645f9b679383bb728 (patch)
treec0e49b3806adb06e26b8460c8abf2e4d8a792722
parentb2efac468744ce418329438fe413cea578d35d61 (diff)
downloadplan9front-baf20a548b903bb76f94045645f9b679383bb728.tar.xz
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).
-rw-r--r--sys/src/cmd/rio/wind.c7
-rw-r--r--sys/src/cmd/rio/xfid.c6
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: