From 5c7cd39166b9ad107262217c3d0360d162f1800a Mon Sep 17 00:00:00 2001 From: hkc Date: Wed, 10 Apr 2024 15:39:44 +0300 Subject: [PATCH] Debug prints --- src/rootwindow.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/rootwindow.c b/src/rootwindow.c index 90e0539..752adc6 100644 --- a/src/rootwindow.c +++ b/src/rootwindow.c @@ -10,12 +10,18 @@ xcb_window_t find_subwindow(xcb_connection_t *connection, xcb_window_t win, int w, int h); xcb_window_t create_root_window(xcb_connection_t *connection, xcb_screen_t *screen) { + fprintf(stderr, "DBG: screen root WID=0x%08x\n", screen->root); + xcb_window_t root = find_subwindow(connection, screen->root, -1, -1); if (!root) return 0; + fprintf(stderr, "DBG: root WID=0x%08x\n", root); + xcb_window_t parent = find_subwindow(connection, root, screen->width_in_pixels, screen->height_in_pixels); if (!parent) return 0; + fprintf(stderr, "DBG: parent WID=0x%08x\n", parent); + xcb_window_t wid = xcb_generate_id(connection); { @@ -87,11 +93,15 @@ xcb_window_t find_subwindow(xcb_connection_t *connection, xcb_window_t win, int if (!get_window_attributes(connection, children[i], &attrs)) continue; if (attrs.map_state != 0 && rect.width == w && rect.height == h) { + fprintf(stderr, "DBG: matching window WID=0x%08x x=%d y=%d w=%d h=%d\n", children[i], rect.x, rect.y, rect.width, rect.height); free(qt_reply); return children[i]; } } free(qt_reply); } + + fprintf(stderr, "ERR: didn't find matching subwindow, returning WID=0x%08x\n", win); + return win; }