private void OnPointerUp(GuiPointerEventArgs args) { if (Screen == null) { return; } var postFocusedControl = FindControlAtPoint(Screen.Controls, args.Position); if (_preFocusedControl == postFocusedControl) { var focusedControl = postFocusedControl; if (_focusedControl != focusedControl) { if (_focusedControl != null) { _focusedControl.IsFocused = false; } _focusedControl = focusedControl; if (_focusedControl != null) { _focusedControl.IsFocused = true; } } } _preFocusedControl = null; _hoveredControl?.OnPointerUp(args); }