DSPointer: send mouse event with winX, winY coordinates 58/242758/1
authorSung-Jin Park <sj76.park@samsung.com>
Fri, 28 Aug 2020 04:21:25 +0000 (13:21 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Tue, 1 Sep 2020 01:29:20 +0000 (10:29 +0900)
Change-Id: Ib327cdf2fd670cfc2cdbdef40bc78c56e7ff5a90
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/DSSeat/DSPointer.cpp

index 12f3c0c..02e3b3b 100644 (file)
@@ -63,9 +63,10 @@ void DSPointer::processEvent(DSInputMouseEvent *ev, void *data)
 
        if (ev->getType() == DSInputEvent::MouseInEvent)
        {
-               DSLOG_DBG("DSTouch", "[mouseIn] devicename: %s, timestamp: %u\n",
-                                       ev->getDevice()->getName().c_str(), ev->getTimestamp());
-               mouseIn(ev->getX(), ev->getY());
+               DSLOG_DBG("DSTouch", "[mouseIn] 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());
+               mouseIn(ev->getWinX(), ev->getWinY());
        }
        else if (ev->getType() == DSInputEvent::MouseOutEvent)
        {
@@ -81,9 +82,10 @@ void DSPointer::processEvent(DSInputMouseEvent *ev, void *data)
        }
        else if (ev->getType() == DSInputEvent::MouseMoveEvent)
        {
-               DSLOG_DBG("DSTouch", "[mouseMove] devicename: %s, timestamp: %u\n",
-                                       ev->getDevice()->getName().c_str(), ev->getTimestamp());
-               mouseMove(ev->getX(), ev->getY());
+               DSLOG_DBG("DSTouch", "[mouseMove] 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());
+               mouseMove(ev->getWinX(), ev->getWinY());
        }
        else if (ev->getType() == DSInputEvent::MouseUpEvent)
        {
@@ -100,7 +102,7 @@ void DSPointer::processEvent(DSInputMouseEvent *ev, void *data)
 
 void DSPointer::mouseDown(uint32_t button)
 {
-       if (__dswlPointer)
+       if (__ptrFocus && __dswlPointer)
        {
                __dswlPointer->sendButtonDown(button);
        }
@@ -108,7 +110,7 @@ void DSPointer::mouseDown(uint32_t button)
 
 void DSPointer::mouseUp(uint32_t button)
 {
-       if (__dswlPointer)
+       if (__ptrFocus && __dswlPointer)
        {
                __dswlPointer->sendButtonUp(button);
        }
@@ -116,7 +118,7 @@ void DSPointer::mouseUp(uint32_t button)
 
 void DSPointer::mouseMove(int x, int y)
 {
-       if (__dswlPointer)
+       if (__ptrFocus && __dswlPointer)
        {
                __dswlPointer->sendMotion(x, y);
        }