]> git.lizzy.rs Git - bspwm.git/commitdiff
Make the window ID printf format consistent
authorBastien Dejean <nihilhill@gmail.com>
Mon, 4 Jan 2016 14:17:47 +0000 (15:17 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Mon, 4 Jan 2016 14:17:47 +0000 (15:17 +0100)
Fixes #361.

query.c
tests/test_window.c

diff --git a/query.c b/query.c
index faf0cc13c3d6968fca4270f11305dfe7f75e97a7..37d487768fc5e33377474a0c462797a75ba38a77 100644 (file)
--- a/query.c
+++ b/query.c
@@ -248,7 +248,7 @@ void query_node_ids_in(node_t *n, desktop_t *d, monitor_t *m, coordinates_t loc,
                coordinates_t trg = {m, d, n};
                if ((loc.node == NULL || n == loc.node) &&
                    (sel == NULL || node_matches(&trg, &ref, *sel))) {
-                       fprintf(rsp, "0x%07X\n", n->id);
+                       fprintf(rsp, "0x%X\n", n->id);
                }
                query_node_ids_in(n->first_child, d, m, loc, sel, rsp);
                query_node_ids_in(n->second_child, d, m, loc, sel, rsp);
index 1f41a2ce576562771dbd6336a6fed20341f7e6de..8582c7f0ee2848f9467a7cfe6251f9b6bd67224b 100644 (file)
@@ -46,9 +46,9 @@ xcb_gc_t get_font_gc(xcb_connection_t *dpy, xcb_window_t win, const char *font_n
 
 void render_text(xcb_connection_t *dpy, xcb_window_t win, int16_t x, int16_t y)
 {
-       char id[8];
+       char id[10];
        xcb_void_cookie_t ck;
-       snprintf(id, sizeof(id), "%07x", win);
+       snprintf(id, sizeof(id), "0x%X", win);
        xcb_gcontext_t gc = get_font_gc(dpy, win, "-*-fixed-medium-*-*-*-18-*-*-*-*-*-*-*");
        /* Don't work with the _checked ! */
        ck = xcb_image_text_8_checked(dpy, strlen(id), win, gc, x, y, id);