How about in a Win32 -> X11 situation?
This is the situation with the POC patch "Use NtUserGetAncestor() for the foreign window in X11DRV_get_ic()".
Yes in this scenario the hwnd we pass to X11DRV_get_ic isn't the correct one, I intend to change this later in the same way as you did it, but I'd like to have the unix -> win32 callback mechanism settled first.