Fix piece of weird code to fetch background image.

This commit is contained in:
Dave Davenport 2016-06-26 17:10:29 +02:00
parent 6e2d0b6319
commit 4af6976411
1 changed files with 7 additions and 10 deletions

View File

@ -90,7 +90,7 @@ static xcb_pixmap_t get_root_pixmap ( xcb_connection_t *c,
{
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *reply;
xcb_pixmap_t *rootpixmap = NULL;
xcb_pixmap_t rootpixmap = XCB_NONE;
cookie = xcb_get_property ( c,
0,
@ -102,17 +102,14 @@ static xcb_pixmap_t get_root_pixmap ( xcb_connection_t *c,
reply = xcb_get_property_reply ( c, cookie, NULL );
if ( reply &&
( xcb_get_property_value_length ( reply ) == sizeof ( xcb_pixmap_t ) ) ) {
rootpixmap = (xcb_pixmap_t *) xcb_get_property_value ( reply );
}
else {
rootpixmap = XCB_NONE;
if ( reply ) {
if ( xcb_get_property_value_length ( reply ) == sizeof ( xcb_pixmap_t ) ) {
memcpy ( &rootpixmap, xcb_get_property_value ( reply ), sizeof ( xcb_pixmap_t ) );
}
free ( reply );
}
free ( reply );
return *rootpixmap;
return rootpixmap;
}
cairo_surface_t * x11_helper_get_bg_surface ( void )