summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorckanru <ckanru@code.google.com>2011-07-23 18:22:11 +0200
committerChristian Beier <dontmind@freeshell.org>2011-07-23 18:22:11 +0200
commit5be89ead0193f17238a058e6b02e46c83b35ca26 (patch)
tree302790a458862e9e3ba5156c00d041b00e90be1a
parentb6d24bfa115b8ac9d4a16505c8eacacc2b195b15 (diff)
downloadlibtdevnc-5be89ead.tar.gz
libtdevnc-5be89ead.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>
-rw-r--r--examples/android/jni/fbvncserver.c8
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));