Rémi Bernon (@rbernon) commented about dlls/winewayland.drv/wayland_pointer.c:
uint32_t serial, struct wl_surface *wl_surface, wl_fixed_t sx, wl_fixed_t sy) { + struct wayland_surface *surface; + + if (!wl_surface) return; + + pthread_mutex_lock(&process_wayland.pointer.mutex); + if ((surface = wayland_surface_lock_proxy((struct wl_proxy *)wl_surface))) + { + TRACE("surface=%p hwnd=%p\n", surface, surface->hwnd); + process_wayland.pointer.surface = surface; + pthread_mutex_unlock(&surface->mutex); + } + pthread_mutex_unlock(&process_wayland.pointer.mutex);
I'm a bit uncomfortable with the double locking everywhere. I think it'd be less scary if we could do something like: ```C HWND hwnd = wayland_surface_get_hwnd(wl_surface); pthread_mutex_lock(&process_wayland.pointer.mutex); process_wayland.pointer.hwnd = hwnd; pthread_mutex_unlock(&process_wayland.pointer.mutex); ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3686#note_43874