Cosmetic
This commit is contained in:
parent
75926a6039
commit
da5236d57a
|
@ -52,12 +52,10 @@ xgettextprop(xcb_connection_t *conn, xcb_window_t w, xcb_atom_t atom,
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
prop_val = (char *) xcb_get_property_value(name);
|
prop_val = (char *) xcb_get_property_value(name);
|
||||||
if(name->type == STRING)
|
|
||||||
a_strncpy(text, name->value_len + 1, prop_val, textlen - 1);
|
|
||||||
|
|
||||||
/* TODO: XCB doesn't provide a XmbTextPropertyToTextList(), check
|
/* TODO: XCB doesn't provide a XmbTextPropertyToTextList(), check
|
||||||
* whether this code is correct (locales) */
|
* whether this code is correct (locales) */
|
||||||
else if(name->format == 8)
|
if(name->type == STRING || name->format == 8)
|
||||||
a_strncpy(text, name->value_len + 1, prop_val, textlen - 1);
|
a_strncpy(text, name->value_len + 1, prop_val, textlen - 1);
|
||||||
|
|
||||||
text[textlen - 1] = '\0';
|
text[textlen - 1] = '\0';
|
||||||
|
|
13
ewmh.c
13
ewmh.c
|
@ -431,14 +431,15 @@ ewmh_get_window_icon(xcb_window_t w)
|
||||||
NetWMIcon *icon;
|
NetWMIcon *icon;
|
||||||
int size, i;
|
int size, i;
|
||||||
uint32_t *data;
|
uint32_t *data;
|
||||||
unsigned char *imgdata, *wdata;
|
unsigned char *imgdata;
|
||||||
xcb_get_property_reply_t *r;
|
xcb_get_property_reply_t *r;
|
||||||
|
|
||||||
r = xcb_get_property_reply(globalconf.connection,
|
r = xcb_get_property_reply(globalconf.connection,
|
||||||
xcb_get_property_unchecked(globalconf.connection, false, w,
|
xcb_get_property_unchecked(globalconf.connection, false, w,
|
||||||
net_wm_icon, CARDINAL, 0, UINT32_MAX),
|
net_wm_icon, CARDINAL, 0, UINT32_MAX),
|
||||||
NULL);
|
NULL);
|
||||||
if(!r || !(wdata = (unsigned char *) xcb_get_property_value(r)))
|
if(!r || r->type != CARDINAL || r->format != 32 || r->length < 2 ||
|
||||||
|
!(data = (uint32_t *) xcb_get_property_value(r)))
|
||||||
{
|
{
|
||||||
if(r)
|
if(r)
|
||||||
p_delete(&r);
|
p_delete(&r);
|
||||||
|
@ -446,16 +447,8 @@ ewmh_get_window_icon(xcb_window_t w)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(r->type != CARDINAL || r->format != 32 || r->length < 2)
|
|
||||||
{
|
|
||||||
p_delete(&r);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
icon = p_new(NetWMIcon, 1);
|
icon = p_new(NetWMIcon, 1);
|
||||||
|
|
||||||
data = (uint32_t *) wdata;
|
|
||||||
|
|
||||||
icon->width = data[0];
|
icon->width = data[0];
|
||||||
icon->height = data[1];
|
icon->height = data[1];
|
||||||
size = icon->width * icon->height;
|
size = icon->width * icon->height;
|
||||||
|
|
Loading…
Reference in New Issue