From 580aef939f3f9a91dd1bbd23eec825981c6fa93b Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Thu, 15 Feb 2024 20:12:20 +0000 Subject: [PATCH] atom: add get_atom_cached Add a version of get_atom that does not query the X server. Signed-off-by: Yuxuan Shui --- src/atom.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/atom.h b/src/atom.h index 29374d9..91c2829 100644 --- a/src/atom.h +++ b/src/atom.h @@ -65,6 +65,10 @@ static inline xcb_atom_t get_atom(struct atom *a, const char *key) { return (xcb_atom_t)(intptr_t)cache_get_or_fetch(a->c, key, NULL); } +static inline xcb_atom_t get_atom_cached(struct atom *a, const char *key) { + return (xcb_atom_t)(intptr_t)cache_get(a->c, key); +} + static inline void destroy_atoms(struct atom *a) { cache_free(a->c); free(a);