Etaash Mathamsetty (@etaash.mathamsetty) commented about dlls/winewayland.drv/window.c:
/* Get the managed state with win_data unlocked, as is_window_managed * may need to query win_data information about other HWNDs and thus * acquire the lock itself internally. */ - if (!(managed = is_window_managed(hwnd, swp_flags, fullscreen)) && surface) toplevel = owner_hint; + if (!(managed = is_window_managed(hwnd, swp_flags, fullscreen)) && surface) owner = owner_hint; + + TRACE("hwnd %p owner %p toplevel %p new_rects %s after %p flags %08x\n", hwnd, + owner, toplevel, debugstr_window_rects(new_rects), insert_after, swp_flags);
if (!(data = wayland_win_data_get(hwnd))) return; - toplevel_data = toplevel && toplevel != hwnd ? wayland_win_data_get_nolock(toplevel) : NULL; - toplevel_surface = toplevel_data ? toplevel_data->wayland_surface : NULL; + owner_data = owner && owner != hwnd ? wayland_win_data_get_nolock(owner) : NULL; + owner_surface = owner_data ? owner_data->wayland_surface : NULL; + /* for it to be a popup, we need a valid xdg surface. */ + if (owner_surface && !owner_surface->xdg_surface) owner_surface = NULL;
Ok next question is: Do we need to worry about attempting to change the role of the toplevel such that it is a popup when there is an owner? (This would be handled automatically with the next WindowPosChanged, so would we need to do something to trigger this?) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11178#note_143765