Wrap root window background prop check

It might be reused by the backends.

Depends on what the backend API ends up look like.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-02-07 00:30:32 +00:00
parent 7d00b89364
commit 856ad4b230
4 changed files with 5 additions and 31 deletions

View File

@ -432,21 +432,7 @@ static bool get_root_tile(session_t *ps) {
ps->root_tile_fill = false;
bool fill = false;
xcb_pixmap_t pixmap = XCB_NONE;
// Get the values of background attributes
for (int p = 0; background_props_str[p]; p++) {
winprop_t prop =
wid_get_prop(ps, ps->root, get_atom(ps, background_props_str[p]), 1L,
XCB_ATOM_PIXMAP, 32);
if (prop.nitems) {
pixmap = *prop.p32;
fill = false;
free_winprop(&prop);
break;
}
free_winprop(&prop);
}
xcb_pixmap_t pixmap = x_get_root_back_pixmap(ps);
// Make sure the pixmap we got is valid
if (pixmap && !x_validate_pixmap(ps->c, pixmap))