libdraw: don't flush in readmouse() when theres nothing to flush
This commit is contained in:
parent
2dddca9847
commit
7b8fcd1269
1 changed files with 5 additions and 2 deletions
|
@ -26,8 +26,11 @@ closemouse(Mousectl *mc)
|
|||
int
|
||||
readmouse(Mousectl *mc)
|
||||
{
|
||||
if(mc->image)
|
||||
flushimage(mc->image->display, 1);
|
||||
if(mc->image){
|
||||
Display *d = mc->image->display;
|
||||
if(d->bufp > d->buf)
|
||||
flushimage(d, 1);
|
||||
}
|
||||
if(recv(mc->c, &mc->Mouse) < 0){
|
||||
fprint(2, "readmouse: %r\n");
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue