[PATCH v3 1/2] oleacc: Check proper UI thread for window focus.

Connor McAdams cmcadams at codeweavers.com
Tue Sep 7 14:04:15 CDT 2021


On Sat, Aug 28, 2021 at 03:32:59PM +0200, Piotr Caban wrote:
> Hi Connor,
> 
> The patch looks good for me.
> 
> On 8/12/21 9:07 PM, Connor McAdams wrote:
> > +    info.cbSize = sizeof(info);
> > +    if(GetGUIThreadInfo(GetWindowThreadProcessId(This->hwnd, NULL), &info) &&
> > +            info.hwndFocus == This->hwnd)
> It doesn't really matter but you can just call GetGUIThreadInfo(0, &info)
> here. If This->hwnd thread is not foreground the hwnd comparison will always
> fail.
>

Sorry for replying late, I was out last week.

Just tested out doing `GetGUIThreadInfo(0, &info)` and it doesn't work
properly unless the window is visible, i.e ShowWindow(hwnd, TRUE) is
called before GetGUIThreadInfo(0, &info).

I also did some more testing on the weird `EVENT_SYSTEM_FOCUSABLE`
behavior, and it seems like our current behavior matches Windows, in
that any accessible object representing an HWND is always considered
`focusable` so long as it isn't disabled, which contradicts the
documentation.

I can send a newer version of the patch with tests for these, if you
think that's necessary. But, I think the current patches work
functionally as is, unless there are some stylistic errors.



More information about the wine-devel mailing list