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
|
int
|
||||||
readmouse(Mousectl *mc)
|
readmouse(Mousectl *mc)
|
||||||
{
|
{
|
||||||
if(mc->image)
|
if(mc->image){
|
||||||
flushimage(mc->image->display, 1);
|
Display *d = mc->image->display;
|
||||||
|
if(d->bufp > d->buf)
|
||||||
|
flushimage(d, 1);
|
||||||
|
}
|
||||||
if(recv(mc->c, &mc->Mouse) < 0){
|
if(recv(mc->c, &mc->Mouse) < 0){
|
||||||
fprint(2, "readmouse: %r\n");
|
fprint(2, "readmouse: %r\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue