From: giwoong.kim Date: Wed, 18 Jul 2012 11:45:37 +0000 (+0900) Subject: [Title] set initial value to touchscreen buf X-Git-Tag: TizenStudio_2.0_p2.3~1396^2~107 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ceb41e9f6d3870c0eb90ae8a87e827146532069c;p=sdk%2Femulator%2Fqemu.git [Title] set initial value to touchscreen buf [Type] bugfix [Module] Emultor / touch [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- 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;