diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-05-13 23:46:45 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-05-13 23:46:45 +0200 |
commit | 24e73840072b4214b3c5e2167a85bdc408fd3b03 (patch) | |
tree | 5aff1b52cc1194db90bfb471bf7e47dc6f8395fc /sys/src/cmd/rio/wind.c | |
parent | 918e791bc8e34f1298a4280d696f5559b35e9cf9 (diff) |
rio: get rid of all mouse moves, fix cursor handling
Diffstat (limited to 'sys/src/cmd/rio/wind.c')
-rw-r--r-- | sys/src/cmd/rio/wind.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/sys/src/cmd/rio/wind.c b/sys/src/cmd/rio/wind.c index d68584040..c90912639 100644 --- a/sys/src/cmd/rio/wind.c +++ b/sys/src/cmd/rio/wind.c @@ -687,7 +687,7 @@ wkeyctl(Window *w, Rune r) --w->holding; else w->holding++; - wsetcursor(w, 0); + wsetcursor(w, FALSE); wrepaint(w); if(r == Kesc) return; @@ -871,9 +871,9 @@ wplumb(Window *w) m->data = runetobyte(w->r+p0, p1-p0, &m->ndata); if(plumbsend(fd, m) < 0){ c = lastcursor; - riosetcursor(&query, 1); + riosetcursor(&query); sleep(300); - riosetcursor(c, 1); + riosetcursor(c); } plumbfree(m); } @@ -903,12 +903,6 @@ wlook(Window *w) wshow(w, i); } -int -winborder(Window *w, Point xy) -{ - return ptinrect(xy, w->screenr) && !ptinrect(xy, insetrect(w->screenr, Selborder)); -} - void wmousectl(Window *w) { @@ -1199,7 +1193,7 @@ wctlmesg(Window *w, int m, Rectangle r, void *p) if(w->i==nil) break; if(w==input) - wsetcursor(w, 0); + wsetcursor(w, FALSE); wrepaint(w); flushimage(display, 1); break; @@ -1299,6 +1293,8 @@ wsetcursor(Window *w, int force) { Cursor *p; + if(menuing || sweeping) + return; if(w==nil || w->i==nil || Dx(w->screenr)<=0) p = nil; else if(wpointto(mouse->xy) == w){ @@ -1307,20 +1303,20 @@ wsetcursor(Window *w, int force) p = &whitearrow; }else p = nil; - if(!menuing) - riosetcursor(p, force && !menuing); + if(force) /* force cursor reload */ + lastcursor = nil; + riosetcursor(p); } void -riosetcursor(Cursor *p, int force) +riosetcursor(Cursor *p) { - if(!force && p==lastcursor) + if(p==lastcursor) return; setcursor(mousectl, p); lastcursor = p; } - void wtopme(Window *w) { @@ -1377,7 +1373,7 @@ wclunk(Window *w) w->deleted = TRUE; if(w == input){ input = nil; - wsetcursor(w, 0); + wsetcursor(w, FALSE); } if(w == wkeyboard) wkeyboard = nil; |