]> git.sur5r.net Git - i3/i3/blobdiff - libi3/dpi.c
Free allocated X resource value. (#2620)
[i3/i3] / libi3 / dpi.c
index a832a689c40600b089ffbfdc2f5dd7421bb34ef5..ce85cacc59fcc2d48c0b35877a334f323ab73c15 100644 (file)
@@ -53,6 +53,10 @@ void init_dpi(void) {
     DLOG("Found Xft.dpi = %ld.\n", dpi);
 
 init_dpi_end:
+    if (resource != NULL) {
+        free(resource);
+    }
+
     if (database != NULL) {
         xcb_xrm_database_free(database);
     }
@@ -64,6 +68,14 @@ init_dpi_end:
     }
 }
 
+/*
+ * This function returns the value of the DPI setting.
+ *
+ */
+long get_dpi_value(void) {
+    return dpi;
+}
+
 /*
  * Convert a logical amount of pixels (e.g. 2 pixels on a “standard” 96 DPI
  * screen) to a corresponding amount of physical pixels on a standard or retina