Alexandros Frantzis (@afrantzis) commented about dlls/winewayland.drv/window.c:
- if (!client && !(client = wayland_client_surface_create(hwnd)))
- {
if (data) wayland_win_data_release(data);
return NULL;
- }
- if (!data) return client;
- if (surface && NtUserIsWindowVisible(hwnd))
wayland_client_surface_attach(client, surface);
- else
wayland_client_surface_detach(client);
- if (!data->client_surface)
- {
InterlockedIncrement(&client->ref);
Not sure if this is intentional, but placing the ref increment here changes the ownership semantics, leading to protocol errors in games (due to a premature release of client surface).
Something along the lines of `if (data->client_surface) InterlockedIncrement(&client->ref);` would restore the previous behavior, i.e., `get_client_surface()` always returns a reference which is co-owned by the caller(s) and `data->client_surface` (previously `wayland_surface->client`) is not an owning reference.