diff options
author | ckanru <ckanru@code.google.com> | 2011-07-23 18:22:11 +0200 |
---|---|---|
committer | Christian Beier <dontmind@freeshell.org> | 2011-07-23 18:22:11 +0200 |
commit | 5be89ead0193f17238a058e6b02e46c83b35ca26 (patch) | |
tree | 302790a458862e9e3ba5156c00d041b00e90be1a /examples | |
parent | b6d24bfa115b8ac9d4a16505c8eacacc2b195b15 (diff) | |
download | libtdevnc-5be89ead0193f17238a058e6b02e46c83b35ca26.tar.gz libtdevnc-5be89ead0193f17238a058e6b02e46c83b35ca26.zip |
Fixes running vncserver on beagleboard/0xdroid and possibly any device
without a touch screen. Because fake touch screen always report
zero when query device information, coordinates transformation is not
needed.
Signed-off-by: Christian Beier <dontmind@freeshell.org>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/android/jni/fbvncserver.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/android/jni/fbvncserver.c b/examples/android/jni/fbvncserver.c index dea4d85..694209c 100644 --- a/examples/android/jni/fbvncserver.c +++ b/examples/android/jni/fbvncserver.c @@ -309,8 +309,12 @@ void injectTouchEvent(int down, int x, int y) struct input_event ev; // Calculate the final x and y - x = xmin + (x * (xmax - xmin)) / (scrinfo.xres); - y = ymin + (y * (ymax - ymin)) / (scrinfo.yres); + /* Fake touch screen always reports zero */ + if (xmin != 0 && xmax != 0 && ymin != 0 && ymax != 0) + { + x = xmin + (x * (xmax - xmin)) / (scrinfo.xres); + y = ymin + (y * (ymax - ymin)) / (scrinfo.yres); + } memset(&ev, 0, sizeof(ev)); |