X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=i3-config-wizard%2Fmain.c;h=679c5e6db5206eefb951c7d115099cb7fbf86044;hb=2896ae80574c237afb64427a6a5412994c87fa30;hp=be042673f2c53a02a1bbe8855fa13f38ced2b9c0;hpb=36fdab7b6ae4ef1eb45519145fdb5de5a60ba2ed;p=i3%2Fi3 diff --git a/i3-config-wizard/main.c b/i3-config-wizard/main.c index be042673..679c5e6d 100644 --- a/i3-config-wizard/main.c +++ b/i3-config-wizard/main.c @@ -69,6 +69,7 @@ enum { MOD_Mod1, MOD_Mod4 } modifier = MOD_Mod4; static char *config_path; static uint32_t xcb_numlock_mask; xcb_connection_t *conn; +xcb_screen_t *root_screen; static xcb_get_modifier_mapping_reply_t *modmap_reply; static i3Font font; static i3Font bold_font; @@ -83,6 +84,26 @@ Display *dpy; char *rewrite_binding(const char *bindingline); static void finish(); +/* + * Having verboselog() and errorlog() is necessary when using libi3. + * + */ +void verboselog(char *fmt, ...) { + va_list args; + + va_start(args, fmt); + vfprintf(stdout, fmt, args); + va_end(args); +} + +void errorlog(char *fmt, ...) { + va_list args; + + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); +} + /* * This function resolves ~ in pathnames. * It may resolve wildcards in the first part of the path, but if no match @@ -128,7 +149,7 @@ static int handle_expose() { set_font(&font); #define txt(x, row, text) \ - draw_text(text, strlen(text), false, pixmap, pixmap_gc,\ + draw_text_ascii(text, pixmap, pixmap_gc,\ x, (row - 1) * font.height + 4, 300 - x * 2) if (current_step == STEP_WELCOME) { @@ -456,7 +477,7 @@ int main(int argc, char *argv[]) { #include "atoms.xmacro" #undef xmacro - xcb_screen_t *root_screen = xcb_aux_get_screen(conn, screens); + root_screen = xcb_aux_get_screen(conn, screens); root = root_screen->root; if (!(modmap_reply = xcb_get_modifier_mapping_reply(conn, modmap_cookie, NULL)))