]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xdg-activation: temporarily disable source surface verification
authortokyo4j <hrak1529@gmail.com>
Fri, 9 Aug 2024 06:56:26 +0000 (15:56 +0900)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Sun, 11 Aug 2024 07:33:26 +0000 (09:33 +0200)
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.

src/xdg.c

index ad0e19c158a95d80d1976bd83dc79fef0a793477..eb1061412ef8aa24da429fb84c5b93d38d54768c 100644 (file)
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -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");