From ee75a26177296b0378f0da03ea20e4021f7db773 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Fri, 28 Aug 2020 13:21:25 +0900 Subject: [PATCH] DSPointer: send mouse event with winX, winY coordinates Change-Id: Ib327cdf2fd670cfc2cdbdef40bc78c56e7ff5a90 Signed-off-by: Sung-Jin Park --- src/DSSeat/DSPointer.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/DSSeat/DSPointer.cpp b/src/DSSeat/DSPointer.cpp index 12f3c0c..02e3b3b 100644 --- a/src/DSSeat/DSPointer.cpp +++ b/src/DSSeat/DSPointer.cpp @@ -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); } -- 2.7.4