Navigation
API > API/Plugins > API/Plugins/CommonUI > API/Plugins/CommonUI/UCommonActivatableWidgetContaine-
Description
This is a bit hairy and very edge-casey, but a necessary measure to ensure expected Slate interaction behavior.
Since we immediately remove slots from our switcher in response to changes to the active index of the switcher, we can wind up confusing the HittestGrid for that frame. The grid (correctly) thinks the widget at the previously displayed index is what it should interact with, but it skips it because we've already released all references and destroyed it. This causes pointer input (most importantly the synthetic mouse move) to fall through our container for that frame, potentially triggering interactions with elements that, as far as any user can tell, were never actually visible!
So, when we remove a slot, we hold a reference to the SWidget in that slot for a single frame, to ensure hittest grid integrity. This does delay destruction of the removed SObjectWidget by one frame, but that does not present any discernable issue, as it's no different from any other inactive widget within a switcher.
| Name | ReleaseWidget |
| Type | function |
| Header File | /Engine/Plugins/Runtime/CommonUI/Source/CommonUI/Public/Widgets/CommonActivatableWidgetContainer.h |
| Include Path | #include "Widgets/CommonActivatableWidgetContainer.h" |
| Source | /Engine/Plugins/Runtime/CommonUI/Source/CommonUI/Private/Widgets/CommonActivatableWidgetContainer.cpp |
void ReleaseWidget
(
const TSharedRef < SWidget > & WidgetToRelease
)