Widgets/Canvas: Fix OnFocusLost being called before removing focus
This commit is contained in:
@@ -84,11 +84,13 @@ namespace Nz
|
|||||||
{
|
{
|
||||||
if (m_keyboardOwner != canvasIndex)
|
if (m_keyboardOwner != canvasIndex)
|
||||||
{
|
{
|
||||||
if (m_keyboardOwner != InvalidCanvasIndex)
|
std::size_t previousOwner = m_keyboardOwner;
|
||||||
m_widgetEntries[m_keyboardOwner].widget->OnFocusLost();
|
|
||||||
|
|
||||||
m_keyboardOwner = canvasIndex;
|
m_keyboardOwner = canvasIndex;
|
||||||
|
|
||||||
|
if (previousOwner != InvalidCanvasIndex)
|
||||||
|
m_widgetEntries[previousOwner].widget->OnFocusLost();
|
||||||
|
|
||||||
if (m_keyboardOwner != InvalidCanvasIndex)
|
if (m_keyboardOwner != InvalidCanvasIndex)
|
||||||
m_widgetEntries[m_keyboardOwner].widget->OnFocusReceived();
|
m_widgetEntries[m_keyboardOwner].widget->OnFocusReceived();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user