From 19cc7a2f2f566cb06bee57990ed1f7def2b46246 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Fri, 28 Aug 2020 13:23:37 +0900 Subject: [PATCH] DSSeat: set winX/winY before sending event(s) to touch/pointer Change-Id: I1254f9f1070118317d0007fa117381e9e3f34a31 Signed-off-by: Sung-Jin Park --- src/DSSeat/DSSeat.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/DSSeat/DSSeat.cpp b/src/DSSeat/DSSeat.cpp index 0030478..599d32b 100644 --- a/src/DSSeat/DSSeat.cpp +++ b/src/DSSeat/DSSeat.cpp @@ -425,7 +425,19 @@ void DSSeat::__onPointerEvent(DSInputMouseEvent *ev) //set the window as pointer focus window if (window) + { + int winX; + int winY; + stPosition pos; + + pos = window->getPosition(); + winX = ev->getX() - pos.x; + winY = ev->getY() - pos.y; + ev->setWinX(winX); + ev->setWinY(winY); + __pointer->setFocus(window); + } //send pointer enter to the new pointer focus window std::shared_ptr evMouseIn = std::make_shared(ev->getDevice(), DSInputEvent::MouseInEvent, ev->getTimestamp(), ev->getButton(), 0, 0, 0); @@ -454,7 +466,19 @@ void DSSeat::__onTouchEvent(DSInputTouchEvent *ev) //set the window as touch focus window if (window) + { + int winX; + int winY; + stPosition pos; + + pos = window->getPosition(); + winX = ev->getX() - pos.x; + winY = ev->getY() - pos.y; + ev->setWinX(winX); + ev->setWinY(winY); + __touch->setFocus(window); + } //TODO : emit touch focus changed signal } -- 2.7.4