[PATCH v2 0/2] MR7763: winex11: Avoid sending WM_MOUSEACTIVATE on WM_TAKE_FOCUS.
It confuses Unity and breaks input after alt-tab. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48121 -- v2: winemac: Avoid sending WM_MOUSEACTIVATE on WM_TAKE_FOCUS. winex11: Avoid sending WM_MOUSEACTIVATE on WM_TAKE_FOCUS. https://gitlab.winehq.org/wine/wine/-/merge_requests/7763
From: Rémi Bernon <rbernon(a)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()) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7763
From: Rémi Bernon <rbernon(a)codeweavers.com> It confuses Unity and breaks input after alt-tab. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48121 --- dlls/winemac.drv/window.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index ca3b0a24050..ca82c920cdf 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1895,17 +1895,9 @@ void macdrv_window_got_focus(HWND hwnd, const macdrv_event *event) if (can_window_become_foreground(hwnd) && !(style & WS_MINIMIZE)) { - /* 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) - { - TRACE("setting foreground window to %p\n", hwnd); - NtUserSetForegroundWindow(hwnd); - return; - } + TRACE("setting foreground window to %p\n", hwnd); + NtUserSetForegroundWindow(hwnd); + return; } TRACE("win %p/%p rejecting focus\n", hwnd, event->window); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7763
On Tue Apr 8 17:25:54 2025 +0000, Tim Clem wrote:
For what it's worth, CrossOver has carried a hack that removes the WM_MOUSEACTIVATE from macdrv for about 4 years. Thanks for the info, I added the same kind of change to winemac.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/7763#note_100286
participants (1)
-
Rémi Bernon