dmwhw / android-vnc-viewer

Automatically exported from code.google.com/p/android-vnc-viewer
0 stars 0 forks source link

Send text results in incorrect text #331

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open a VNC connection to a server
2. Give focus to any kind of text input field
3. Use the Send Text command to type some text click either Send button

What is the expected output? What do you see instead?
Expected to insert the text as written into the text box. _Most_ of the 
characters appear (some are lost) and their order differs from the input. For 
example typing "Lorem ipsum dolor sit amet" may result in "Lroem ipsumdoolr 
sitamet ".

What version of android-vnc-viewer are you using?
The v0_5_0 tag.

Which VNC server/version are you using?  On which platform?
Xvnc (started with inetd) and libvnc.so both show the same results. The server 
is an openSUSE 13.1 x64 box.

What is the size of the desktop you are trying to access (i.e. 1024x768,
1920x1080...)?
The bug occurs with multiple resolutions, tested with the displays native 
resolution of 1920x1080 and an Xvnc session set to the resolution of the phone 
(800x480)

What device are you using?
An Alcatel OT 995 with the 4.0.4 firmware from Android, but also occurs in 
Android Emulator.

Are you using a custom ROM?  If so, which?
-

Please provide any additional information below.
Looking at the code of the v0.5.0 tag I managed to work around the issue by 
adding a slight delay (a 20ms sleep) between keypresses (actually after both 
calls to RfbProto.writeKeyEvent from EnterTextDialog.sendText()) and forcing a 
flush after writing the event buffer in RfbProto.writeKeyEvent. Also tried a 
10ms sleep but the bug still occured.

Original issue reported on code.google.com by szigeti....@gmail.com on 1 Mar 2014 at 12:18

GoogleCodeExporter commented 8 years ago
The phones firmware is of course from Alcatel, not Android.

Original comment by szigeti....@gmail.com on 1 Mar 2014 at 12:20

GoogleCodeExporter commented 8 years ago
Here's the patch of the workaround.

Original comment by szigeti....@gmail.com on 1 Mar 2014 at 12:30

Attachments:

GoogleCodeExporter commented 8 years ago
Futher investigation shows that the flush and the synchronized keyword on 
sendText as in the previous patch are not neccessary, but both sleepForAWhile 
calls are.

Attached is a screenshot: the first two (or four, depending on how you count) 
lines of Lorem ipsum were "typed" with a version of android-vnc-viewer without 
the delay and they display both the wrong order (like doolr) of characters and 
missing ones.
The bottom two lines were sent from a version of android-vnc-viewer with both 
calls to sleepForAWhile as in the patch.

It's not visible on the picture, but sleeping between characters and not 
keypresses worked about 99% of the time, but also made mistakes (also in the 
word dolor, just like the first line).

This time I ran the tests in an android emulator, running two AVDs side-by-side 
with the same virtual HW (7" 800x480 display, Android 2.2 - API Level 8, ARM 
(armeabi), HW keyboard, no cameras, 512 MB Ram, 200 MB internal storage and no 
SD Card).

Original comment by szigeti....@gmail.com on 1 Mar 2014 at 1:37

Attachments: