Я пытаюсь получить информацию об окне в фокусе. Кажется, я получаю правильный идентификатор окна из xcb_get_input_focus_reply_t->focus
: он остается прежним для моей Eclipse IDE (56623164) и другим для любого другого окна в фокусе. Однако длина значения всегда равна 0 для XCB_ATOM_WM_NAME
.
сокращенный код
cookie = xcb_get_property(c, 0, fr->focus, XCB_ATOM_WM_NAME,
XCB_ATOM_STRING, 0, 0);
if ((reply = xcb_get_property_reply(c, cookie, NULL))) {
int len = xcb_get_property_value_length(reply);
if (len == 0) {
printf("Zero Length\n");
free(reply);
return;
}
printf("WM_NAME is %.*s\n", len, (char*) xcb_get_property_value(reply));
}
Отладчик Eclipse
reply xcb_get_property_reply_t * 0x60bd40
response_type uint8_t 1 '\001'
format uint8_t 0 '\0'
sequence uint16_t 2
length uint32_t 0
type xcb_atom_t 0
bytes_after uint32_t 0
value_len uint32_t 0
pad0 unsigned char [12] 0x60bd54
Ошибки нет (прошел и проверил xcb_generic_error_t
). Вы хоть представляете, что может пойти не так? Может быть, мне следует использовать Xlib вместо этого...