From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Tue, 7 May 2013 12:02:43 +0300 Message-ID: From: Yaroslav To: 9fans@9fans.net Content-Type: text/plain; charset=UTF-8 Subject: [9fans] vncv sw cursor trail Topicbox-Message-UUID: 5786168a-ead8-11e9-9d60-3106f5b1d025 When using vncv on a terminal with software cursor (vesa, rpi) the mouse cursor leaves a trail. This seem to be caused by the fact that vncv loads picture updates with loadimage(2) directly to screen. Loading to an offscreen image followed by a draw(2) to screen removes the artifact: /n/dump/2013/0507/sys/src/cmd/vnc/draw.c:106,111 - /sys/src/cmd/vnc/draw.c:106,112 static void updatescreen(Rectangle r) { + Image* img; int b, bb; lockdisplay(display); /n/dump/2013/0507/sys/src/cmd/vnc/draw.c:120,129 - /sys/src/cmd/vnc/draw.c:121,135 /* * assume load image fails only because of resize */ + img = allocimage(display, r, screen->chan, 0, DNofill); + if(img == nil) + sysfatal("updatescreen: %r"); b = Dx(r) * pixb * Dy(r); - bb = loadimage(screen, rectaddpt(r, screen->r.min), pixbuf, b); + bb = loadimage(img, r, pixbuf, b); if(bb != b && verbose) fprint(2, "loadimage %d on %R for %R returned %d: %r\n", b, rectaddpt(r, screen->r.min), screen->r, bb); + draw(screen, rectaddpt(r, screen->r.min), img, nil, r.min); + freeimage(img); unlockdisplay(display); } Submitted as /n/sources/patch/vncv-curtrail -- - Yaroslav