xdg-activation: temporarily disable source surface verification

71451173 validates the xdg-activation token more strictly by verifying
the source surface attached to the token. That  improves the security by
preventing arbitrary focus-stealing.

However, not all clients attach a right source surface to the token or
use the received token for activation. For example, when a notification
client requests thunderbird to activate its window, thunderbird doesn't
use the token passed by the notification client and instead use their own
token, thus the activation is rejected as the surface attached to the
token is not focused.

We will add options to configure the policy for activation requests or
implement urgency hint in some way in the future and reland the source
surface verification.
This commit is contained in:
tokyo4j 2024-08-09 15:56:26 +09:00 committed by Consolatis
parent 72df8fe73c
commit de38c771fc

View file

@ -785,10 +785,17 @@ xdg_activation_handle_request(struct wl_listener *listener, void *data)
return;
}
if (!token_data->had_valid_surface) {
wlr_log(WLR_INFO, "Denying focus request, source surface not set");
return;
}
/*
* TODO: The verification of source surface is temporarily disabled to
* allow activation of some clients (e.g. thunderbird). Reland this
* check when we implement the configuration for activation policy or
* urgency hints.
*
* if (!token_data->had_valid_surface) {
* wlr_log(WLR_INFO, "Denying focus request, source surface not set");
* return;
* }
*/
if (window_rules_get_property(view, "ignoreFocusRequest") == LAB_PROP_TRUE) {
wlr_log(WLR_INFO, "Ignoring focus request due to window rule configuration");