https://bugs.winehq.org/show_bug.cgi?id=56278
Bug ID: 56278 Summary: wayland: dropdowns is rendered as toplevel Product: Wine Version: 9.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: hugo@whynothugo.nl Distribution: ---
When using the wayland driver, dropdown menus are rendered as their own toplevel windows.
On tiling window managers (e.g.: swaywm), this results in it being tiled just like any other window. I can't imagine that they would be placed correctly on stacking window managers either.
I confirmed with lswt that dropdowns are effectively rendered as toplevels. An xdg_popup should be used here instead: https://wayland.app/protocols/xdg-shell#xdg_popup
The weirdness in behaviour can be reproduced with:
- wine reg.exe add HKCU\Software\Wine\Drivers /v Graphics /d wayland - winecfg - Go to the desktop integration tab and click on any dropdown
https://bugs.winehq.org/show_bug.cgi?id=56278
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |winewayland
https://bugs.winehq.org/show_bug.cgi?id=56278
startrix dmorilha@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dmorilha@gmail.com
--- Comment #1 from startrix dmorilha@gmail.com --- Hi, I can confirm this issue, I've solved it by making the pop-up float and moving next to the mouse's position.
Many applications have a similar incosistent behaviour under swaywm and the usual way I proceed is to filter by the application's app_id and specify different window configurations in sway config:
for_window [app_id="wine"] { floating enable move position pointer }
As of 9.4, it looks like Wine Wayland's windows lack an app_id, so I worked on a one liner fix for that:
--- dlls/winewayland.drv/wayland_surface.c 2024-03-19 09:13:58.518464069 -0500 +++ dlls/winewayland.drv/wayland_surface.c.new 2024-03-19 09:13:49.298425977 -0500 @@ -251,6 +251,7 @@
surface->xdg_toplevel = xdg_surface_get_toplevel(surface->xdg_surface); if (!surface->xdg_toplevel) goto err; + xdg_toplevel_set_app_id(surface->xdg_toplevel, "wine"); xdg_toplevel_add_listener(surface->xdg_toplevel, &xdg_toplevel_listener, surface->hwnd);
wl_surface_commit(surface->wl_surface);
Best,