if (!window)
{
DSLOG_ERR("DSKeyboard", "Given window is INVALID. (window : %p)", window);
+ __kbdFocus = window;
+ if (__dswlKeyboard)
+ __dswlKeyboard->setFocus(nullptr);
return;
}
if (!waylandSurface)
{
- DSLOG_ERR("DSKeyboard", "Wayland surface of the given window is INVALID. (window : %p, surface : %p)", window, waylandSurface);
+ DSLOG_ERR("DSKeyboard", "Wayland surface of the given window is INVALID. (window : %p (%p), surface : %p)", window, window.get(), waylandSurface);
return;
}
- DSLOG_INF("DSKeyboard", "focus window has been changed. (%p -> %p)", __kbdFocus, window);
+ DSLOG_INF("DSKeyboard", "focus window has been changed. (%p -> %p)", __kbdFocus ? __kbdFocus.get() : nullptr, window ? window.get() : nullptr);
__kbdFocus = window;
if (!__dswlKeyboard)
}
+void DSKeyboard::resetFocus()
+{
+ if (__kbdFocus)
+ {
+ __kbdFocus = nullptr;
+ DSLOG_INF("DSKeyboard", "kbdFocus has been reset.");
+ }
+
+ if (__dswlKeyboard)
+ __dswlKeyboard->resetFocus();
+}
+
std::shared_ptr<DSWindow> DSKeyboard::getFocus()
{
return __kbdFocus;