]> git.sur5r.net Git - i3/i3/commitdiff
Merge pull request #2551 from bapt/freebsd_fixes
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Wed, 16 Nov 2016 21:48:05 +0000 (13:48 -0800)
committerGitHub <noreply@github.com>
Wed, 16 Nov 2016 21:48:05 +0000 (13:48 -0800)
Freebsd fixes

i3bar/src/main.c
include/libi3.h
libi3/dpi.c
libi3/font.c
release.sh
src/commands.c
src/display_version.c

index be684fc5d1f32b935f994e876dd1a203718bdc37..910e952482f0d788b46747ac0b9bab396242f7c5 100644 (file)
@@ -149,6 +149,8 @@ int main(int argc, char **argv) {
         socket_path = expand_path(i3_default_sock_path);
     }
 
+    init_dpi();
+
     init_outputs();
     if (init_connection(socket_path)) {
         /* Request the bar configuration. When it arrives, we fill the config array. */
index 11ca31273b828cbf38036e8358421040da64a1db..94e1d78ba6a3c75e9acaefb884f367a4336033a4 100644 (file)
@@ -473,6 +473,12 @@ char *get_exe_path(const char *argv0);
  */
 void init_dpi(void);
 
+/**
+ * This function returns the value of the DPI setting.
+ *
+ */
+long get_dpi_value(void);
+
 /**
  * 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
index a832a689c40600b089ffbfdc2f5dd7421bb34ef5..d0d1bc6896e89c36067e2d026c1101dcd84d2b6b 100644 (file)
@@ -64,6 +64,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
index fa8484813b472c3b9a28c7473da9f229effb2bb4..81091ea74a31da11d392864c1158ed387b0da1cd 100644 (file)
@@ -24,24 +24,12 @@ static double pango_font_red;
 static double pango_font_green;
 static double pango_font_blue;
 
-/* Necessary to track whether the dpi changes and trigger a LOG() message,
- * which is more easily visible to users. */
-static double logged_dpi = 0.0;
-
 static PangoLayout *create_layout_with_dpi(cairo_t *cr) {
     PangoLayout *layout;
     PangoContext *context;
 
     context = pango_cairo_create_context(cr);
-    const double dpi = (double)root_screen->height_in_pixels * 25.4 /
-                       (double)root_screen->height_in_millimeters;
-    if (logged_dpi != dpi) {
-        logged_dpi = dpi;
-        LOG("X11 root window dictates %f DPI\n", dpi);
-    } else {
-        DLOG("X11 root window dictates %f DPI\n", dpi);
-    }
-    pango_cairo_context_set_resolution(context, dpi);
+    pango_cairo_context_set_resolution(context, get_dpi_value());
     layout = pango_layout_new(context);
     g_object_unref(context);
 
index 9101332c100761bc841e2367e2c8ec88138b40fc..33cb4f532d1acc58d5d858cd73724c48696ca656 100755 (executable)
@@ -236,3 +236,4 @@ echo "Announce on:"
 echo "  twitter"
 echo "  google+"
 echo "  #i3 topic"
+echo "  reddit /r/i3wm"
index 70622b7db15ca608a3b19ffe870f2afcfdd4c264..2387ddd7fd06615e6e0070075e4d7a33f99d6900 100644 (file)
@@ -893,8 +893,10 @@ void cmd_workspace_number(I3_CMD, const char *which, const char *_no_auto_back_a
         cmd_output->needs_tree_render = true;
         return;
     }
-    if (!no_auto_back_and_forth && maybe_back_and_forth(cmd_output, workspace->name))
+    if (!no_auto_back_and_forth && maybe_back_and_forth(cmd_output, workspace->name)) {
+        ysuccess(true);
         return;
+    }
     workspace_show(workspace);
 
     cmd_output->needs_tree_render = true;
@@ -940,8 +942,10 @@ void cmd_workspace_name(I3_CMD, const char *name, const char *_no_auto_back_and_
     }
 
     DLOG("should switch to workspace %s\n", name);
-    if (!no_auto_back_and_forth && maybe_back_and_forth(cmd_output, name))
+    if (!no_auto_back_and_forth && maybe_back_and_forth(cmd_output, name)) {
+        ysuccess(true);
         return;
+    }
     workspace_show_by_name(name);
 
     cmd_output->needs_tree_render = true;
index 0e650e817378174f39a7bd5def167b144a508769..764ee753177f1875a5de4fdd65827a19fadad985 100644 (file)
@@ -182,4 +182,7 @@ void display_running_version(void) {
 #endif
 
     yajl_free(handle);
+    free(reply);
+    free(pid_from_atom);
+    free(socket_path);
 }