From: Sung-Jin Park Date: Thu, 20 Aug 2020 06:05:01 +0000 (+0900) Subject: DSTouch: add resetFocus(), fix setFocus() X-Git-Tag: accepted/tizen/unified/20200820.213435~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=662e3f9617b3b3ddcd468b095e7ac5d70681e3ff;p=platform%2Fcore%2Fuifw%2Flibds.git DSTouch: add resetFocus(), fix setFocus() Change-Id: Ie5885f765c44fc88bfbb2d781810729ed2696aa6 Signed-off-by: Sung-Jin Park --- diff --git a/src/DSSeat/DSTouch.cpp b/src/DSSeat/DSTouch.cpp index 00f8abc..c636dd7 100644 --- a/src/DSSeat/DSTouch.cpp +++ b/src/DSSeat/DSTouch.cpp @@ -108,6 +108,9 @@ void DSTouch::setFocus(std::shared_ptr window) if (!window) { DSLOG_ERR("DSTouch", "Given window is INVALID. (window : %p)", window); + __touchFocus = window; + if (__dswlTouch) + __dswlTouch->setFocus(nullptr); return; } @@ -131,6 +134,18 @@ void DSTouch::setFocus(std::shared_ptr window) __dswlTouch->setFocus(waylandSurface); } +void DSTouch::resetFocus() +{ + if (__touchFocus) + { + __touchFocus = nullptr; + DSLOG_INF("DSTouch", "touchFocus has been reset."); + } + + if (__dswlTouch) + __dswlTouch->resetFocus(); +} + std::shared_ptr DSTouch::getFocus() { return __touchFocus; diff --git a/src/DSSeat/DSTouch.h b/src/DSSeat/DSTouch.h index 99c8d7a..ef164d9 100644 --- a/src/DSSeat/DSTouch.h +++ b/src/DSSeat/DSTouch.h @@ -49,6 +49,7 @@ public: void touchUp(int32_t id); void touchMove(int32_t id, int x, int y); void setFocus(std::shared_ptr window); + void resetFocus(); std::shared_ptr getFocus(); private: