diff --git a/src/kekengine/cpp/common/defaults.cpp b/src/kekengine/cpp/common/defaults.cpp index 346bfa6..aa3340e 100644 --- a/src/kekengine/cpp/common/defaults.cpp +++ b/src/kekengine/cpp/common/defaults.cpp @@ -69,7 +69,9 @@ static void doUIMouseClick(double x, double y, GLFWMouseButton button) { clickedElement->clickAll(clickedAt, UIPoint((int) x, (int) y), button); if(button == GLFWMouseButton::LEFT) { - clickedElement->focusEnterAll(clickedAt, UIPoint((int) x, (int) y)); + if(!clickedElement->focusEnterAll(clickedAt, UIPoint((int) x, (int) y))) { + UI::unfocusElement(kekData.ui->focusedElement); + } } } else { UI::unfocusElement(kekData.ui->focusedElement);