Add a function that allocates a pixmap and checks success

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2018-09-30 09:31:22 +02:00
parent 6ec951763e
commit 8848676540
3 changed files with 37 additions and 15 deletions

View File

@ -193,11 +193,9 @@ x_create_picture(session_t *ps, int wid, int hei,
int depth = pictfmt->depth;
xcb_connection_t *c = XGetXCBConnection(ps->dpy);
Pixmap tmp_pixmap = xcb_generate_id(c);
Pixmap tmp_pixmap = create_pixmap(ps, depth, ps->root, wid, hei);
if (!tmp_pixmap)
return None;
xcb_create_pixmap(c, depth, tmp_pixmap, ps->root, wid, hei);
xcb_render_picture_t picture =
x_create_picture_with_pictfmt_and_pixmap(ps, pictfmt, tmp_pixmap, valuemask, attr);