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).
This commit is contained in:
parent
b2efac4687
commit
baf20a548b
2 changed files with 5 additions and 8 deletions
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue