]> git.sur5r.net Git - i3/i3/blobdiff - libi3/dpi.c
taint mode fix for FreeBSD
[i3/i3] / libi3 / dpi.c
index f105ef9aed710189529b247433037df0d26a1bac..ce85cacc59fcc2d48c0b35877a334f323ab73c15 100644 (file)
@@ -6,6 +6,7 @@
  *
  */
 #include "libi3.h"
+
 #include <math.h>
 #include <stdlib.h>
 #include <xcb/xcb_xrm.h>
@@ -52,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);
     }
@@ -63,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