Alexandros Frantzis (@afrantzis) commented about dlls/winewayland.drv/window.c:
/* If the window is a visible toplevel make it a wayland * xdg_toplevel. Otherwise keep it role-less to avoid polluting the * compositor with empty xdg_toplevels. */
if (visible) wayland_surface_make_toplevel(surface);
if (visible)
{
wayland_surface_make_toplevel(surface);
if (!NtUserInternalGetWindowText(data->hwnd, text, ARRAY_SIZE(text)))
Although unlikely, the preceding call may have failed to create `surface->xdg_toplevel` so we still need to check it:
```suggestion:-0+2 if(surface->xdg_toplevel) { if (!NtUserInternalGetWindowText(data->hwnd, text, ARRAY_SIZE(text))) text[0] = 0; wayland_surface_set_title(surface, text); } ```