DSTouch: send touch event with winX, winY coordinates 57/242757/1
authorSung-Jin Park <sj76.park@samsung.com>
Fri, 28 Aug 2020 04:21:00 +0000 (13:21 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Tue, 1 Sep 2020 01:29:19 +0000 (10:29 +0900)
Change-Id: I5e19092c1797d2262dc608686a3bb64bb564b3f7
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/DSSeat/DSTouch.cpp

index c636dd7..37b17fb 100644 (file)
@@ -61,9 +61,10 @@ void DSTouch::processEvent(DSInputTouchEvent *ev, void *data)
 
        if (ev->getType() == DSInputEvent::TouchDownEvent)
        {
-               DSLOG_DBG("DSTouch", "[touchDown] devicename: %s, timestamp: %u\n",
-                                       ev->getDevice()->getName().c_str(), ev->getTimestamp());
-               touchDown(ev->getIndex(), ev->getX(), ev->getY());
+               DSLOG_DBG("DSTouch", "[touchDown] devicename: %s, timestamp: %u, x: %d (winX: %d), y: %d (winY: %d)\n",
+                                       ev->getDevice()->getName().c_str(), ev->getTimestamp(),
+                                       ev->getX(), ev->getWinX(), ev->getY(), ev->getWinY());
+               touchDown(ev->getIndex(), ev->getWinX(), ev->getWinY());
        }
        else if (ev->getType() == DSInputEvent::TouchUpEvent)
        {
@@ -73,15 +74,16 @@ void DSTouch::processEvent(DSInputTouchEvent *ev, void *data)
        }
        else//DSInputEvent::TouchMoveEvent
        {
-               DSLOG_DBG("DSTouch", "[touchDown] devicename: %s, timestamp: %u\n",
-                                       ev->getDevice()->getName().c_str(), ev->getTimestamp());
-               touchMove(ev->getIndex(), ev->getX(), ev->getY());
+               DSLOG_DBG("DSTouch", "[touchDown] devicename: %s, timestamp: %u, x: %d (winX: %d), y: %d (winY: %d)\n",
+                                       ev->getDevice()->getName().c_str(), ev->getTimestamp(),
+                                       ev->getX(), ev->getWinX(), ev->getY(), ev->getWinY());
+               touchMove(ev->getIndex(), ev->getWinX(), ev->getWinY());
        }
 }
 
 void DSTouch::touchDown(int32_t id, int x, int y)
 {
-       if (__dswlTouch)
+       if (__touchFocus && __dswlTouch)
        {
                __dswlTouch->sendDown(id, x, y);
        }
@@ -89,7 +91,7 @@ void DSTouch::touchDown(int32_t id, int x, int y)
 
 void DSTouch::touchUp(int32_t id)
 {
-       if (__dswlTouch)
+       if (__touchFocus && __dswlTouch)
        {
                __dswlTouch->sendUp(id);
        }
@@ -97,7 +99,7 @@ void DSTouch::touchUp(int32_t id)
 
 void DSTouch::touchMove(int32_t id, int x, int y)
 {
-       if (__dswlTouch)
+       if (__touchFocus && __dswlTouch)
        {
                __dswlTouch->sendMotion(id, x, y);
        }