From ceb41e9f6d3870c0eb90ae8a87e827146532069c Mon Sep 17 00:00:00 2001 From: "giwoong.kim" Date: Wed, 18 Jul 2012 20:45:37 +0900 Subject: [PATCH] [Title] set initial value to touchscreen buf [Type] bugfix [Module] Emultor / touch [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- tizen/src/hw/maru_touchscreen.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tizen/src/hw/maru_touchscreen.c b/tizen/src/hw/maru_touchscreen.c index 7c63f5b..4941151 100644 --- a/tizen/src/hw/maru_touchscreen.c +++ b/tizen/src/hw/maru_touchscreen.c @@ -111,15 +111,7 @@ static int usb_touchscreen_poll(USBTouchscreenState *s, uint8_t *buf, int len) if (s->buttons_state == 0) { packet->state = 0; } else { - if (s->buttons_state & MOUSE_EVENT_LBUTTON) { - packet->state |= 1; - } - if (s->buttons_state & MOUSE_EVENT_RBUTTON) { - packet->state |= 2; - } - if (s->buttons_state & MOUSE_EVENT_MBUTTON) { - packet->state |= 4; - } + packet->state = 1; } return EMUL_TOUCHSCREEN_PACKET_LEN; @@ -194,6 +186,7 @@ static int usb_touchscreen_handle_data(USBDevice *dev, USBPacket *p) pthread_mutex_unlock(&event_mutex); + memset(buf, 0, sizeof(buf) * (p->iov.size - 1)); ret = usb_touchscreen_poll(s, buf, p->iov.size); //write event to packet usb_packet_copy(p, buf, ret); break; -- 2.7.4