From 76f51a949f55c865e3ea1c90965afd4d835baad9 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 1 Jun 2021 11:29:10 +0200 Subject: xdg-activation-v1: add token timeout There isn't always a good time to prune old tokens. Compositors which only implement a "give focus on activation" logic can prune tokens on focus change. However other compositors might want to implement other semantics, e.g. "mark urgent on activation". In this case a focus change shouldn't invalidate other tokens. Additionally, some tokens aren't necessarily tied to a seat. To avoid ending up with an ever-growing list of tokens, add a timeout. --- include/wlr/types/wlr_xdg_activation_v1.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_xdg_activation_v1.h b/include/wlr/types/wlr_xdg_activation_v1.h index 121e66a1..04558a08 100644 --- a/include/wlr/types/wlr_xdg_activation_v1.h +++ b/include/wlr/types/wlr_xdg_activation_v1.h @@ -26,12 +26,14 @@ struct wlr_xdg_activation_token_v1 { char *token; struct wl_resource *resource; // can be NULL + struct wl_event_source *timeout; // can be NULL struct wl_listener seat_destroy; struct wl_listener surface_destroy; }; struct wlr_xdg_activation_v1 { + uint32_t token_timeout_msec; // token timeout in milliseconds (0 to disable) struct wl_list tokens; // wlr_xdg_activation_token_v1.link -- cgit v1.2.3