From 65b6a767d7b0de0866d8ec81e08dea59eb3bfd0e Mon Sep 17 00:00:00 2001 From: IceSqueez Date: Mon, 3 Aug 2026 23:30:31 +0300 Subject: [PATCH 1/2] windows.ui.core.textinput: Return success from CoreInputView Try* methods. The stubs returned E_NOTIMPL, which the C++/WinRT projection turns into an unhandled hresult_not_implemented exception. Unity 6 titles (e.g. Albion Online) call CoreInputView.GetForCurrentView().TryHide() whenever a text field is committed and crash on the exception. Report success instead: TryShow* returns FALSE (no input pane can be shown), TryHide* returns TRUE (nothing is shown, so it is hidden). --- dlls/windows.ui.core.textinput/main.c | 30 ++++++++++++++++++--------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/dlls/windows.ui.core.textinput/main.c b/dlls/windows.ui.core.textinput/main.c index 25110e09be9f..4259fbad7d91 100644 --- a/dlls/windows.ui.core.textinput/main.c +++ b/dlls/windows.ui.core.textinput/main.c @@ -159,14 +159,18 @@ static HRESULT WINAPI core_input_view_GetCoreInputViewOcclusions(ICoreInputView static HRESULT WINAPI core_input_view_TryShowPrimaryView(ICoreInputView *iface, boolean *result) { - FIXME("iface %p, boolean %p stub!\n", iface, result); - return E_NOTIMPL; + FIXME("iface %p, boolean %p semi-stub!\n", iface, result); + + *result = FALSE; + return S_OK; } static HRESULT WINAPI core_input_view_TryHidePrimaryView(ICoreInputView *iface, boolean *result) { - FIXME("iface %p, boolean %p stub!\n", iface, result); - return E_NOTIMPL; + FIXME("iface %p, boolean %p semi-stub!\n", iface, result); + + *result = TRUE; + return S_OK; } static const struct ICoreInputViewVtbl core_input_view_vtbl = @@ -249,22 +253,28 @@ DEFINE_IINSPECTABLE(core_input_view3, ICoreInputView3, struct core_input_view, I static HRESULT WINAPI core_input_view3_TryShow(ICoreInputView3 *iface, boolean *result) { - FIXME("iface %p, result %p stub!\n", iface, result); - return E_NOTIMPL; + FIXME("iface %p, result %p semi-stub!\n", iface, result); + + *result = FALSE; + return S_OK; } static HRESULT WINAPI core_input_view3_TryShowWithKind(ICoreInputView3 *iface, CoreInputViewKind type, boolean *result) { - FIXME("iface %p, type %d, result %p stub!\n", iface, type, result); - return E_NOTIMPL; + FIXME("iface %p, type %d, result %p semi-stub!\n", iface, type, result); + + *result = FALSE; + return S_OK; } static HRESULT WINAPI core_input_view3_TryHide(ICoreInputView3 *iface, boolean *result) { - FIXME("iface %p, result %p stub!\n", iface, result); - return E_NOTIMPL; + FIXME("iface %p, result %p semi-stub!\n", iface, result); + + *result = TRUE; + return S_OK; } static const struct ICoreInputView3Vtbl core_input_view3_vtbl = From c37ede82cf8da2c51b36bef833ca27808a4461d3 Mon Sep 17 00:00:00 2001 From: IceSqueez Date: Mon, 3 Aug 2026 23:59:45 +0300 Subject: [PATCH 2/2] windows.ui.core.textinput: Toggle the Proton OSK from CoreInputView Try* methods. Mirror the InputPane implementation in windows.ui: locate the tabtip window and post WM_TABTIP_OSK_TOGGLE from TryShow*/TryHide*, so the Steam on-screen keyboard follows text field focus in titles using CoreInputView (Unity 6). TryShowWithKind only toggles the keyboard for the Default and Keyboard kinds; the other panes do not exist. Reported results are unchanged: TryShow* returns FALSE, TryHide* returns TRUE. --- dlls/windows.ui.core.textinput/Makefile.in | 2 +- dlls/windows.ui.core.textinput/main.c | 29 ++++++++++++++++++++++ dlls/windows.ui.core.textinput/private.h | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/dlls/windows.ui.core.textinput/Makefile.in b/dlls/windows.ui.core.textinput/Makefile.in index 38d07a5a5c0b..168ebcc21cad 100644 --- a/dlls/windows.ui.core.textinput/Makefile.in +++ b/dlls/windows.ui.core.textinput/Makefile.in @@ -1,5 +1,5 @@ MODULE = windows.ui.core.textinput.dll -IMPORTS = combase +IMPORTS = combase user32 SOURCES = \ classes.idl \ diff --git a/dlls/windows.ui.core.textinput/main.c b/dlls/windows.ui.core.textinput/main.c index 4259fbad7d91..57aeef9c2456 100644 --- a/dlls/windows.ui.core.textinput/main.c +++ b/dlls/windows.ui.core.textinput/main.c @@ -23,6 +23,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(coreinputview); +#define WM_TABTIP_OSK_TOGGLE (WM_USER + 1) + struct core_input_view { ICoreInputView ICoreInputView_iface; @@ -30,6 +32,7 @@ struct core_input_view ICoreInputView3 ICoreInputView3_iface; ICoreInputView4 ICoreInputView4_iface; struct weak_reference_source weak_reference_source; + HWND tabtip_hwnd; }; static inline struct core_input_view *impl_from_ICoreInputView(ICoreInputView *iface) @@ -159,16 +162,26 @@ static HRESULT WINAPI core_input_view_GetCoreInputViewOcclusions(ICoreInputView static HRESULT WINAPI core_input_view_TryShowPrimaryView(ICoreInputView *iface, boolean *result) { + struct core_input_view *impl = impl_from_ICoreInputView(iface); + FIXME("iface %p, boolean %p semi-stub!\n", iface, result); + if (impl->tabtip_hwnd) + PostMessageW(impl->tabtip_hwnd, WM_TABTIP_OSK_TOGGLE, TRUE, 0); + *result = FALSE; return S_OK; } static HRESULT WINAPI core_input_view_TryHidePrimaryView(ICoreInputView *iface, boolean *result) { + struct core_input_view *impl = impl_from_ICoreInputView(iface); + FIXME("iface %p, boolean %p semi-stub!\n", iface, result); + if (impl->tabtip_hwnd) + PostMessageW(impl->tabtip_hwnd, WM_TABTIP_OSK_TOGGLE, FALSE, 0); + *result = TRUE; return S_OK; } @@ -253,8 +266,13 @@ DEFINE_IINSPECTABLE(core_input_view3, ICoreInputView3, struct core_input_view, I static HRESULT WINAPI core_input_view3_TryShow(ICoreInputView3 *iface, boolean *result) { + struct core_input_view *impl = impl_from_ICoreInputView3(iface); + FIXME("iface %p, result %p semi-stub!\n", iface, result); + if (impl->tabtip_hwnd) + PostMessageW(impl->tabtip_hwnd, WM_TABTIP_OSK_TOGGLE, TRUE, 0); + *result = FALSE; return S_OK; } @@ -263,16 +281,26 @@ static HRESULT WINAPI core_input_view3_TryShowWithKind(ICoreInputView3 *iface, CoreInputViewKind type, boolean *result) { + struct core_input_view *impl = impl_from_ICoreInputView3(iface); + FIXME("iface %p, type %d, result %p semi-stub!\n", iface, type, result); + if (impl->tabtip_hwnd && (type == CoreInputViewKind_Default || type == CoreInputViewKind_Keyboard)) + PostMessageW(impl->tabtip_hwnd, WM_TABTIP_OSK_TOGGLE, TRUE, 0); + *result = FALSE; return S_OK; } static HRESULT WINAPI core_input_view3_TryHide(ICoreInputView3 *iface, boolean *result) { + struct core_input_view *impl = impl_from_ICoreInputView3(iface); + FIXME("iface %p, result %p semi-stub!\n", iface, result); + if (impl->tabtip_hwnd) + PostMessageW(impl->tabtip_hwnd, WM_TABTIP_OSK_TOGGLE, FALSE, 0); + *result = TRUE; return S_OK; } @@ -453,6 +481,7 @@ static HRESULT WINAPI core_input_view_statics_GetForCurrentView(ICoreInputViewSt view->ICoreInputView2_iface.lpVtbl = &core_input_view2_vtbl; view->ICoreInputView3_iface.lpVtbl = &core_input_view3_vtbl; view->ICoreInputView4_iface.lpVtbl = &core_input_view4_vtbl; + view->tabtip_hwnd = FindWindowW(L"IPTip_Main_Window", L"Input"); if (FAILED(hr = weak_reference_source_init(&view->weak_reference_source, (IUnknown *)&view->ICoreInputView_iface))) diff --git a/dlls/windows.ui.core.textinput/private.h b/dlls/windows.ui.core.textinput/private.h index 8b9e6419410f..80aaca727df6 100644 --- a/dlls/windows.ui.core.textinput/private.h +++ b/dlls/windows.ui.core.textinput/private.h @@ -23,6 +23,7 @@ #define COBJMACROS #include "windef.h" #include "winbase.h" +#include "winuser.h" #include "winstring.h" #include "activation.h" #include "wine/debug.h"