Module: wine Branch: master Commit: fdbb46faf2ab38d4c8b7954f43382ece1594a54c URL: https://source.winehq.org/git/wine.git/?a=commit;h=fdbb46faf2ab38d4c8b7954f4...
Author: Connor McAdams conmanx360@gmail.com Date: Thu Sep 16 13:54:17 2021 +0200
oleacc: Check proper GUI thread for window focus.
Check for window focus against the current foreground window's thread GUI data rather than the currently executing thread's GUI data.
Signed-off-by: Connor McAdams conmanx360@gmail.com Signed-off-by: Piotr Caban piotr@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/oleacc/client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/oleacc/client.c b/dlls/oleacc/client.c index 3b33be55a21..0c2215fe62e 100644 --- a/dlls/oleacc/client.c +++ b/dlls/oleacc/client.c @@ -227,6 +227,7 @@ static HRESULT WINAPI Client_get_accRole(IAccessible *iface, VARIANT varID, VARI static HRESULT WINAPI Client_get_accState(IAccessible *iface, VARIANT varID, VARIANT *pvarState) { Client *This = impl_from_Client(iface); + GUITHREADINFO info; LONG style;
TRACE("(%p)->(%s %p)\n", This, debugstr_variant(&varID), pvarState); @@ -244,7 +245,9 @@ static HRESULT WINAPI Client_get_accState(IAccessible *iface, VARIANT varID, VAR V_I4(pvarState) |= STATE_SYSTEM_UNAVAILABLE; else if(IsWindow(This->hwnd)) V_I4(pvarState) |= STATE_SYSTEM_FOCUSABLE; - if(GetFocus() == This->hwnd) + + info.cbSize = sizeof(info); + if(GetGUIThreadInfo(0, &info) && info.hwndFocus == This->hwnd) V_I4(pvarState) |= STATE_SYSTEM_FOCUSED; if(!(style & WS_VISIBLE)) V_I4(pvarState) |= STATE_SYSTEM_INVISIBLE;