[PATCH] winex11.drv: Always set focus to managed window when requested.

Alexandre Julliard julliard at winehq.org
Mon Dec 23 05:37:26 CST 2019


Rémi Bernon <rbernon at codeweavers.com> writes:

> @@ -700,7 +700,12 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event )
>                 hwnd, IsWindowEnabled(hwnd), IsWindowVisible(hwnd), GetWindowLongW(hwnd, GWL_STYLE),
>                 GetFocus(), GetActiveWindow(), GetForegroundWindow(), last_focus );
>  
> -        if (can_activate_window(hwnd))
> +        if (is_managed(hwnd))
> +        {
> +            set_focus( event->display, hwnd, event_time );
> +            return;
> +        }
> +        else if (can_activate_window(hwnd))

This will completely break the take focus mechanism.

The complicated heuristic to find an appropriate window is very much
necessary, you can't just give focus to the window suggested by the
window manager. For instance, a disabled window should never receive
focus.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list