mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 14:03:26 +02:00
fix crash and focus bug
This commit is contained in:
@@ -245,7 +245,7 @@ void UIWidget::focusChild(const UIWidgetPtr& child, Fw::FocusReason reason)
|
||||
child->updateState(Fw::FocusState);
|
||||
child->updateState(Fw::ActiveState);
|
||||
|
||||
g_eventDispatcher.addEvent(std::bind(&UIWidget::onFocusChange, child, true, reason));
|
||||
child->onFocusChange(true, reason);
|
||||
}
|
||||
|
||||
if(oldFocused) {
|
||||
@@ -253,7 +253,7 @@ void UIWidget::focusChild(const UIWidgetPtr& child, Fw::FocusReason reason)
|
||||
oldFocused->updateState(Fw::FocusState);
|
||||
oldFocused->updateState(Fw::ActiveState);
|
||||
|
||||
g_eventDispatcher.addEvent(std::bind(&UIWidget::onFocusChange, oldFocused, false, reason));
|
||||
oldFocused->onFocusChange(false, reason);
|
||||
}
|
||||
|
||||
onChildFocusChange(child, oldFocused, reason);
|
||||
|
Reference in New Issue
Block a user