atom: add get_atom_cached
Add a version of get_atom that does not query the X server. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user