Sdk/Canvas: Prevent OnFocusLost/OnFocusReceived when using SetFocus on an already focused widget

This commit is contained in:
Jérôme Leclercq 2017-11-23 13:23:54 +01:00
parent 1601849a00
commit d98b7a8f4f
1 changed files with 8 additions and 5 deletions

View File

@ -77,6 +77,8 @@ namespace Ndk
}
inline void Canvas::SetKeyboardOwner(std::size_t canvasIndex)
{
if (m_keyboardOwner != canvasIndex)
{
if (m_keyboardOwner != InvalidCanvasIndex)
m_widgetBoxes[m_keyboardOwner].widget->OnFocusLost();
@ -86,4 +88,5 @@ namespace Ndk
if (m_keyboardOwner != InvalidCanvasIndex)
m_widgetBoxes[m_keyboardOwner].widget->OnFocusReceived();
}
}
}