Esme Povirk (@madewokherd) commented about dlls/uiautomationcore/uia_event.c:
return hr; }
+static HRESULT uia_win_event_for_each_callback(struct uia_event *event, void *data) +{ + struct uia_queue_win_event *win_event = (struct uia_queue_win_event *)data; + + if (!uia_hwnd_map_check_hwnd(&event->u.clientside.win_event_hwnd_map, win_event->hwnd)) + { + /* Top level HWND that isn't within our WinEvent HWND scope. */ + if (uia_is_top_level_hwnd(win_event->hwnd)) + return S_OK; + + /* This isn't a top-level HWND, check if its parent HWND is within our scope. */ + if (!uia_hwnd_map_check_hwnd(&event->u.clientside.win_event_hwnd_map, GetAncestor(win_event->hwnd, GA_PARENT))) + return S_OK;
Is this correct even if the parent is also not a top-level HWND? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3956#note_46838