Alexandros Frantzis (@afrantzis) commented about dlls/winewayland.drv/wayland_text_input.c:
pthread_mutex_lock(&text_input->mutex);
- if (!text_input->zwp_text_input_v3)
if (!text_input->zwp_text_input_v3 || hwnd != text_input->focused_hwnd) goto err;
if (!(data = wayland_win_data_get(hwnd)))
Not blocking for this MR: Although not a problem at the moment (AFAICT), we try not to acquire the `win_data_mutex` while holding other mutexes (keyboard, pointer etc), to avoid potential deadlocks in the future. We can avoid the nested locking in this case too, by first performing the cursor transforms using the provided hwnd and then locking text_input and checking whether it matches the hwnd. In the worst case we will have performed an unnecessary transform. If we find that there is some performance implication we can do a quick lock/check before the transforms, or also check `process_wayland.zwp_text_input_manager_v3` which doesn't need a lock.