#765880 netsurf-fb: every other keystroke lost when using VNC

Package:
netsurf-fb
Source:
netsurf
Description:
small web browser with CSS support for framebuffers
Submitter:
Edward Betts
Date:
2014-12-14 09:42:10 UTC
Severity:
normal
#765880#5
Date:
2014-10-18 21:27:04 UTC
From:
To:
I start netsurf-fb like this: "netsurf-fb -f vnc", I've tried connecting
with three VNC viewers: TightVNC, vinagre and novnc. In all three cases
netsurf is only responding half of my keystrokes, if I type this into
any text box: 12345678, then the text that appears is 1357.

Let me know if you need any more information to reproduce this bug.

#765880#10
Date:
2014-10-21 14:09:25 UTC
From:
To:
This patch half fixes the problem. Once applied there are no more dropped
keystrokes, I type 1234 and that's what appears.

Sometimes it seems like netsurf is waiting for the timeout before the character
appears.

I don't know why rfbProcessEvents is returning -1 when there is a valid event.
--- libnsfb/src/surface/vnc.c.orig 2014-10-21 14:03:31.740181270 +0000 +++ libnsfb/src/surface/vnc.c 2014-10-21 13:54:31.943853884 +0000 @@ -499,7 +499,7 @@ event->value.controlcode = NSFB_CONTROL_TIMEOUT; ret = rfbProcessEvents(vncscreen, timeout * 1000); - if (ret == 0) { + if (ret == 0 || ret == -1) { /* valid event */ return true;
#765880#15
Date:
2014-10-21 15:25:16 UTC
From:
To:
This patch stops the drop keystrokes and update delay. I don't know if it is
correct.

rfbProcessEvents() needs to be called after rfbMarkRectAsModified() for
libvncserver to send updates to clients.

I'm not sure calling it like this will miss some input events, but it seems to work.
--- libnsfb/src/surface/vnc.c.orig 2014-10-21 14:03:31.740181270 +0000 +++ libnsfb/src/surface/vnc.c 2014-10-21 15:20:02.630965646 +0000 @@ -480,6 +480,7 @@ rfbScreenInfoPtr vncscreen = nsfb->surface_priv; rfbMarkRectAsModified(vncscreen, box->x0, box->y0, box->x1, box->y1); + rfbProcessEvents(vncscreen, 1); return 0; } @@ -499,7 +500,7 @@ event->value.controlcode = NSFB_CONTROL_TIMEOUT; ret = rfbProcessEvents(vncscreen, timeout * 1000); - if (ret == 0) { + if (ret == 0 || ret == -1) { /* valid event */ return true;