Sdk/Canvas: Prevent OnFocusLost/OnFocusReceived when using SetFocus on an already focused widget
This commit is contained in:
parent
1601849a00
commit
d98b7a8f4f
|
|
@ -78,12 +78,15 @@ namespace Ndk
|
|||
|
||||
inline void Canvas::SetKeyboardOwner(std::size_t canvasIndex)
|
||||
{
|
||||
if (m_keyboardOwner != InvalidCanvasIndex)
|
||||
m_widgetBoxes[m_keyboardOwner].widget->OnFocusLost();
|
||||
if (m_keyboardOwner != canvasIndex)
|
||||
{
|
||||
if (m_keyboardOwner != InvalidCanvasIndex)
|
||||
m_widgetBoxes[m_keyboardOwner].widget->OnFocusLost();
|
||||
|
||||
m_keyboardOwner = canvasIndex;
|
||||
m_keyboardOwner = canvasIndex;
|
||||
|
||||
if (m_keyboardOwner != InvalidCanvasIndex)
|
||||
m_widgetBoxes[m_keyboardOwner].widget->OnFocusReceived();
|
||||
if (m_keyboardOwner != InvalidCanvasIndex)
|
||||
m_widgetBoxes[m_keyboardOwner].widget->OnFocusReceived();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue