That avoids exceptions in Summoners War: RUSH window procedure. It will except on recursive calls to window procedure which happens on Wine when it calls TrackMouseEvents() on WM_MOUSEMOVE due to TrackMouseEvents() sending WM_NCHITTEST from window_from_point(). The exception currently gets caught but only because user mode callback filter swallows the exception while on Windows that would abort the process.
Overall, the way window_from_point() sends WM_NCHITTEST is not right WRT TrackMouseEvents() anyway. The skip of WM_NCHITTEST for other thread window is correct for WindowFromPoint() implementation but doesn't make sense for TrackMouseEvents purposes. On Windows calling TrackMouseEvents() never results in WM_NCHITTEST. Those will only be sent upon moving the mouse (the same already happens on Wine from process_mouse_message).
Mouse tracking is updated on timer messages which have lowest priorities, so by the time we need to update mouse tracking the latest mouse messages are supposed to be received and we should have update_current_mouse_window() called for the latest mouse updates. We are going to miss the moment the mouse leaves the window (when the hardware mouse messages won't be sent) thus the check in get_mouse_window() for the window_from_point() return for the current cursor position.