fix: temporary focus fix

This commit is contained in:
MihailRis 2026-08-09 21:26:30 +03:00
parent 43acc3ae89
commit 9fa6070cce
2 changed files with 3 additions and 1 deletions

View file

@ -260,7 +260,7 @@ void GUI::act(float delta, const glm::uvec2& vp) {
hover = nullptr;
}
}
if (focus) {
if (focus && focusedOnStart == focus.get()) {
actFocused();
}
if (focus && !focus->isFocused()) {
@ -274,6 +274,7 @@ void GUI::postAct() {
postRunnables.pop();
callback();
}
focusedOnStart = focus.get();
}
void GUI::draw(const DrawContext& pctx, Assets& assets) {

View file

@ -72,6 +72,7 @@ namespace gui {
std::shared_ptr<UINode> hover;
std::shared_ptr<UINode> pressed;
std::shared_ptr<UINode> focus;
const UINode* focusedOnStart = nullptr;
std::shared_ptr<UINode> tooltip;
std::shared_ptr<UiDocument> rootDocument;
std::unique_ptr<FontStylesScheme> syntaxColorScheme;