From 103e1c6593b57ad408c5e64c13d79d21289de620 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Thu, 20 Aug 2020 15:04:25 +0900 Subject: [PATCH] DSPointer: add resetFocus() Change-Id: I6a7e8b1104f92367ba8cefc170b9255886204638 Signed-off-by: Sung-Jin Park --- src/DSSeat/DSPointer.cpp | 12 ++++++++++++ src/DSSeat/DSPointer.h | 1 + 2 files changed, 13 insertions(+) diff --git a/src/DSSeat/DSPointer.cpp b/src/DSSeat/DSPointer.cpp index 3f6375e..12f3c0c 100644 --- a/src/DSSeat/DSPointer.cpp +++ b/src/DSSeat/DSPointer.cpp @@ -169,6 +169,18 @@ void DSPointer::setFocus(std::shared_ptr window) __dswlPointer->setFocus(waylandSurface); } +void DSPointer::resetFocus() +{ + if (__ptrFocus) + { + __ptrFocus = nullptr; + DSLOG_INF("DSPointer", "ptrFocus has been reset."); + } + + if (__dswlPointer) + __dswlPointer->resetFocus(); +} + std::shared_ptr DSPointer::getFocus() { return __ptrFocus; diff --git a/src/DSSeat/DSPointer.h b/src/DSSeat/DSPointer.h index 5717c51..79dc209 100644 --- a/src/DSSeat/DSPointer.h +++ b/src/DSSeat/DSPointer.h @@ -51,6 +51,7 @@ public: void mouseIn(int x, int y); void mouseOut(); void setFocus(std::shared_ptr window); + void resetFocus(); std::shared_ptr getFocus(); private: -- 2.7.4