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. */
*/
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
}
}
+/*
+ * 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
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);
echo " twitter"
echo " google+"
echo " #i3 topic"
+echo " reddit /r/i3wm"
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;
}
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;
#endif
yajl_free(handle);
+ free(reply);
+ free(pid_from_atom);
+ free(socket_path);
}