mirror of
https://github.com/vale981/yabar
synced 2025-03-05 09:31:39 -05:00
Merge pull request #69 from abarbu/master
Fix segfault for some windows with odd ways of handling titles (steam & spotify)
This commit is contained in:
commit
b9b692b956
1 changed files with 8 additions and 6 deletions
|
@ -409,12 +409,14 @@ inline void ya_get_cur_window_title(ya_block_t * blk) {
|
|||
xcb_get_property_cookie_t wm_ck, wmvis_ck;
|
||||
wm_ck = xcb_ewmh_get_wm_name(ya.ewmh, ya.curwin);
|
||||
wmvis_ck = xcb_ewmh_get_wm_visible_name(ya.ewmh, ya.curwin);
|
||||
if (xcb_ewmh_get_wm_name_reply(ya.ewmh, wm_ck, &reply, NULL) == 1 || xcb_ewmh_get_wm_visible_name_reply(ya.ewmh, wmvis_ck, &reply, NULL) == 1) {
|
||||
int len = GET_MIN(blk->bufsize, reply.strings_len);
|
||||
strncpy(blk->buf, reply.strings, len);
|
||||
blk->buf[len]='\0';
|
||||
}
|
||||
xcb_ewmh_get_utf8_strings_reply_wipe(&reply);
|
||||
if (xcb_ewmh_get_wm_name_reply(ya.ewmh, wm_ck, &reply, NULL) == 1) {
|
||||
if (xcb_ewmh_get_wm_visible_name_reply(ya.ewmh, wmvis_ck, &reply, NULL) == 1) {
|
||||
int len = GET_MIN(blk->bufsize, reply.strings_len);
|
||||
strncpy(blk->buf, reply.strings, len);
|
||||
blk->buf[len]='\0';
|
||||
}
|
||||
xcb_ewmh_get_utf8_strings_reply_wipe(&reply);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue