From e4ac6fe8d899574564ecff467f47ef50aedb0c20 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Thu, 16 Nov 2023 15:04:17 +0100 Subject: Implement `update_xrm` for connection --- comet.c | 1 - connection.c | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/comet.c b/comet.c index 38c6db8..825dff0 100644 --- a/comet.c +++ b/comet.c @@ -33,7 +33,6 @@ int main(int argc, char **argv) int screen_width = con->screen_size->width; int screen_height = con->screen_size->height; - log_info("w=%d, h=%d", screen_width, screen_height); int height = EVEN(round(screen_height * 0.021)); int x_padding = EVEN(round(screen_width * 0.005)); diff --git a/connection.c b/connection.c index 0c07c70..8e26283 100644 --- a/connection.c +++ b/connection.c @@ -21,7 +21,17 @@ static bool query_xrm(Connection *con, const char *res, char **value) static void update_xrm(Connection *con) { - // TODO + xcb_flush(con->connection); + xcb_xrm_database_t *database = xcb_xrm_database_from_default(con->connection); + + if (database == NULL) { + log_warning("Xrm database couldn't be updated"); + return; + } + + xcb_xrm_database_free(con->database); + con->database = database; + log_debug("Xrm database updated"); } static void update_scale(Connection *con) -- cgit v1.2.3