Rémi Bernon (@rbernon) commented about dlls/winewayland.drv/opengl.c:
+static struct wayland_gl_drawable *wayland_gl_drawable_get(HWND hwnd) +{
- struct wayland_gl_drawable *gl, *ret = NULL;
- pthread_mutex_lock(&gl_object_mutex);
- LIST_FOR_EACH_ENTRY(gl, &gl_drawables, struct wayland_gl_drawable, entry)
- {
if (gl->hwnd != hwnd) continue;
InterlockedIncrement(&gl->ref);
ret = gl;
break;
- }
- pthread_mutex_unlock(&gl_object_mutex);
- return ret;
+}
Then use the new `find_drawable_for_hwnd` here, and split this too.
```suggestion:-17+0 static struct wayland_gl_drawable *wayland_gl_drawable_acquire(struct wayland_gl_drawable *gl) { InterlockedIncrement(&gl->ref); return ref; }
static struct wayland_gl_drawable *wayland_gl_drawable_get(HWND hwnd) { struct wayland_gl_drawable *ret;
pthread_mutex_lock(&gl_object_mutex); if ((ret = find_drawable_for_hwnd(hwnd))) ret = wayland_gl_drawable_acquire(gl); pthread_mutex_unlock(&gl_object_mutex);
return ret; } ```