Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-tslib: Commit

external/tslib


Commit MetaInfo

Révision0cf7f1407c6c3a5ba2ba5f9886814bd81a891fbe (tree)
l'heure2011-10-24 08:19:22
AuteurBryan Hundven <bryanhundven@gmai...>
CommiterBryan Hundven

Message de Log

Merge branch 'master' into gingerbread-x86

Change Summary

Modification

--- a/plugins/input-raw.c
+++ b/plugins/input-raw.c
@@ -40,6 +40,11 @@
4040 # define KEY_CNT (KEY_MAX+1)
4141 #endif
4242
43+#ifndef ABS_MT_POSITION_X
44+# define ABS_MT_POSITION_X 0x35 /* Center X ellipse position */
45+# define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */
46+#endif
47+
4348 #include "tslib-private.h"
4449
4550 #define GRAB_EVENTS_WANTED 1
@@ -161,16 +166,17 @@ static int ts_input_read(struct tslib_module_info *inf,
161166 }
162167 break;
163168 case EV_SYN:
164- /* Fill out a new complete event */
165- if (pen_up) {
166- samp->x = 0;
167- samp->y = 0;
168- samp->pressure = 0;
169- pen_up = 0;
170- } else {
171- samp->x = i->current_x;
172- samp->y = i->current_y;
173- samp->pressure = i->current_p;
169+ if (ev.code == SYN_REPORT) {
170+ /* Fill out a new complete event */
171+ if (pen_up) {
172+ samp->x = 0;
173+ samp->y = 0;
174+ samp->pressure = 0;
175+ pen_up = 0;
176+ } else {
177+ samp->x = i->current_x;
178+ samp->y = i->current_y;
179+ samp->pressure = i->current_p;
174180 }
175181 samp->tv = ev.time;
176182 #ifdef DEBUG
@@ -180,6 +186,7 @@ static int ts_input_read(struct tslib_module_info *inf,
180186 #endif /* DEBUG */
181187 samp++;
182188 total++;
189+ }
183190 break;
184191 case EV_ABS:
185192 switch (ev.code) {
@@ -191,6 +198,12 @@ static int ts_input_read(struct tslib_module_info *inf,
191198 case ABS_RX:
192199 i->current_y = ev.value;
193200 break;
201+ case ABS_MT_POSITION_X:
202+ i->current_x = ev.value;
203+ break;
204+ case ABS_MT_POSITION_Y:
205+ i->current_y = ev.value;
206+ break;
194207 case ABS_PRESSURE:
195208 i->current_p = ev.value;
196209 break;
--- a/src/ts_close.c
+++ b/src/ts_close.c
@@ -14,12 +14,24 @@
1414 #ifdef HAVE_UNISTD_H
1515 #include <unistd.h>
1616 #endif
17+#include <dlfcn.h>
1718
1819 #include "tslib-private.h"
1920
2021 int ts_close(struct tsdev *ts)
2122 {
23+ void *handle;
2224 int ret;
25+ struct tslib_module_info *info, *prev;
26+
27+ for(info = ts->list, prev = info;
28+ info != NULL;
29+ info = prev->next, prev = info) {
30+ handle = info->handle;
31+ info->ops->fini(info);
32+ if (handle)
33+ dlclose(handle);
34+ }
2335
2436 ret = close(ts->fd);
2537 free(ts);
--- a/src/ts_load_module.c
+++ b/src/ts_load_module.c
@@ -152,6 +152,7 @@ static struct tslib_module_info *__ts_load_module_shared(struct tsdev *ts, const
152152 static int __ts_load_module(struct tsdev *ts, const char *module, const char *params, int raw)
153153 {
154154 struct tslib_module_info *info;
155+ void *handle;
155156 int ret;
156157
157158 #ifdef DEBUG
@@ -173,9 +174,10 @@ static int __ts_load_module(struct tsdev *ts, const char *module, const char *pa
173174 #ifdef DEBUG
174175 fprintf (stderr, "Can't attach %s\n", module);
175176 #endif
177+ handle = info->handle;
176178 info->ops->fini(info);
177- if (info->handle)
178- dlclose(info->handle);
179+ if (handle)
180+ dlclose(handle);
179181 }
180182
181183 return ret;
Afficher sur ancien navigateur de dépôt.