Widgets/Canvas: Fix OnFocusLost being called before removing focus
This commit is contained in:
parent
98c0a47dcc
commit
809dc7e0a7
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue