I have a simple menu, and the only thing focusable are the buttons, but whenever I click anywhere else on the viewport which aren’t buttons, whatever button is currently focused loses keyboard focus and I have to click a button with the mouse to regain focus.
yeah for some reason that doesn’t work. I had to make a giant invisible button that covered the entire viewport behind the menu, and set it to focus on whatever was focused before clicking. janky, but works