It confuses Unity and breaks input after alt-tab.
From: Rémi Bernon rbernon@codeweavers.com
It confuses Unity and breaks input after alt-tab.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48121 --- dlls/winex11.drv/event.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index f9aa4b3f66b..89b99af8951 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -772,16 +772,8 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event )
if (can_activate_window(hwnd)) { - /* simulate a mouse click on the menu to find out - * whether the window wants to be activated */ - LRESULT ma = send_message( hwnd, WM_MOUSEACTIVATE, - (WPARAM)NtUserGetAncestor( hwnd, GA_ROOT ), - MAKELONG( HTMENU, WM_LBUTTONDOWN ) ); - if (ma != MA_NOACTIVATEANDEAT && ma != MA_NOACTIVATE) - { - set_focus( event->display, hwnd, event_time ); - return; - } + set_focus( event->display, hwnd, event_time ); + return; } else if (hwnd == NtUserGetDesktopWindow()) {
We do an analogous thing in macdrv [here](https://gitlab.winehq.org/wine/wine/-/blob/856efc7a958c32a34b3d7e47cc80a8ab0...), which is also known to confuse Unity. Should we remove that as well?
Probably yes, although this has been tested in Proton with many games there's still a possibility that it could break other kind of applications. I'm not completely sure why it was added in the first place.
On Tue Apr 8 17:25:54 2025 +0000, Rémi Bernon wrote:
Probably yes, although this has been tested in Proton with many games there's still a possibility that it could break other kind of applications. I'm not completely sure why it was added in the first place.
For what it's worth, CrossOver has carried a hack that removes the WM_MOUSEACTIVATE from macdrv for about 4 years.