9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] vncv sw cursor trail
@ 2013-05-07  9:02 Yaroslav
  2013-05-07 12:36 ` lucio
  2013-05-07 14:10 ` erik quanstrom
  0 siblings, 2 replies; 11+ messages in thread
From: Yaroslav @ 2013-05-07  9:02 UTC (permalink / raw)
  To: 9fans

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



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-05-08 10:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-07  9:02 [9fans] vncv sw cursor trail Yaroslav
2013-05-07 12:36 ` lucio
2013-05-07 14:10 ` erik quanstrom
2013-05-07 14:12   ` Gorka Guardiola
2013-05-07 14:18     ` erik quanstrom
2013-05-07 14:31   ` Anthony Sorace
2013-05-07 18:50     ` Ярослав Коломієць
2013-05-07 18:48   ` Ярослав Коломієць
2013-05-07 18:54     ` erik quanstrom
2013-05-07 20:19       ` erik quanstrom
2013-05-08 10:40         ` Yaroslav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).