Minor code optimization / pretification
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
7b2627cbf9
commit
7b91cf259c
6
window.c
6
window.c
|
@ -137,10 +137,7 @@ window_opacity_get(xcb_window_t win)
|
||||||
|
|
||||||
prop_r = xcb_get_property_reply(globalconf.connection, prop_c, NULL);
|
prop_r = xcb_get_property_reply(globalconf.connection, prop_c, NULL);
|
||||||
|
|
||||||
if(!prop_r || !prop_r->value_len || prop_r->format != 32)
|
if(prop_r && prop_r->value_len && prop_r->format == 32)
|
||||||
goto bailout;
|
|
||||||
|
|
||||||
if(prop_r->value_len)
|
|
||||||
{
|
{
|
||||||
unsigned int *data = xcb_get_property_value(prop_r);
|
unsigned int *data = xcb_get_property_value(prop_r);
|
||||||
unsigned int value = *data;
|
unsigned int value = *data;
|
||||||
|
@ -148,7 +145,6 @@ window_opacity_get(xcb_window_t win)
|
||||||
return (double) value / (double) 0xffffffff;
|
return (double) value / (double) 0xffffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
bailout:
|
|
||||||
p_delete(&prop_r);
|
p_delete(&prop_r);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue