Description

WidgetComponent controls widgets through VirtualWindow, but VirtualWindow does not have HWND, so IME cannot be enabled.
The following workaround enables IME activation.

 

void FSlateEditableTextLayout::FTextInputMethodContext::CacheWindow()
{
	if (!OwnerLayout)
	{
		return;
	}

	const TSharedRef<const SWidget> OwningSlateWidgetPtr = OwnerLayout->OwnerWidget->GetSlateWidget();
#if 0
	CachedParentWindow = FSlateApplication::Get().FindWidgetWindow(OwningSlateWidgetPtr);
#else  //workaround
	TSharedPtr<SWindow> SlateWindow = FSlateApplication::Get().FindWidgetWindow(OwningSlateWidgetPtr);
	if (SlateWindow->IsVirtualWindow())
	{
		SlateWindow = FSlateApplication::Get().GetActiveTopLevelRegularWindow();
	}
	CachedParentWindow = SlateWindow;
#endif
}

 

 

Steps to Reproduce
  1. Open attached repro project [Link Removed]
  2. Start PIE
  3. Pick up a gun in the level
  4. Turn right and point "Focus textbox below" button and left click
  5. Type some key to input 
  6. Try to enable IME by keyboard shortcut (maybe shift+caps for English keyboard)
  7. Try to input some regional character

Result:

IME cannot be enabled

 

 

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-211575 in the post.

5
Login to Vote

Unresolved
ComponentUE - Editor - UI Systems
Affects Versions5.25.3
Target Fix5.5
CreatedApr 5, 2024
UpdatedMay 17, 2024