On Thu Nov 9 17:06:35 2023 +0000, darkblaze69 wrote:
On GNOME with this patch (on top of 8.18+r83+g0c7a09cb1f9-1) menus in Firefox 3.6 are immediately closed. With clean wine 8.18 and 8.19 they can be opened. https://ftp.mozilla.org/pub/firefox/releases/3.6.28/win32/en-US/ ![Screencast_from_2023-11-06_12-21-21](/uploads/ae2a87d1219ab9a3d36d515b7dfe8ac3/Screencast_from_2023-11-06_12-21-21.webm)
What seems to be causing the problem (which I can also reproduce with GIMP win32, although the details are not exactly the same), is that the menu window reacts badly (i.e., it closes) when we try to make it active. Under Wayland we don't have control over which surfaces get the keyboard focus, so we will need to have some way to detect windows that shouldn't have the focus, and focus an ancestor instead (all of this from the Wine perspective, since we can't affect the compositor's focus).
From a quick look, it seems winex11 deals with this with a combination of making such windows not "managed", and/or some special handling of WM_TAKE_FOCUS. Perhaps we could take some inspiration from these concepts and methods.