mirror of
https://github.com/yshui/picom.git
synced 2024-11-11 13:51:02 -05:00
Replace use of XFreePixmap with XCB
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
9dff55540f
commit
ea9942b87e
3 changed files with 10 additions and 9 deletions
|
@ -2525,7 +2525,8 @@ wintype_arr_enable(bool arr[]) {
|
|||
static inline void
|
||||
free_pixmap(session_t *ps, Pixmap *p) {
|
||||
if (*p) {
|
||||
XFreePixmap(ps->dpy, *p);
|
||||
xcb_connection_t *c = XGetXCBConnection(ps->dpy);
|
||||
xcb_free_pixmap(c, *p);
|
||||
*p = None;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -666,7 +666,7 @@ win_build_shadow(session_t *ps, win *w, double opacity) {
|
|||
|
||||
XFreeGC(ps->dpy, gc);
|
||||
xcb_image_destroy(shadow_image);
|
||||
XFreePixmap(ps->dpy, shadow_pixmap);
|
||||
xcb_free_pixmap(c, shadow_pixmap);
|
||||
xcb_render_free_picture(c, shadow_picture);
|
||||
|
||||
return true;
|
||||
|
@ -675,9 +675,9 @@ shadow_picture_err:
|
|||
if (shadow_image)
|
||||
xcb_image_destroy(shadow_image);
|
||||
if (shadow_pixmap)
|
||||
XFreePixmap(ps->dpy, shadow_pixmap);
|
||||
xcb_free_pixmap(c, shadow_pixmap);
|
||||
if (shadow_pixmap_argb)
|
||||
XFreePixmap(ps->dpy, shadow_pixmap_argb);
|
||||
xcb_free_pixmap(c, shadow_pixmap_argb);
|
||||
if (shadow_picture)
|
||||
xcb_render_free_picture(c, shadow_picture);
|
||||
if (shadow_picture_argb)
|
||||
|
@ -711,7 +711,7 @@ solid_picture(session_t *ps, bool argb, double a,
|
|||
XCB_RENDER_CP_REPEAT, &pa);
|
||||
|
||||
if (!picture) {
|
||||
XFreePixmap(ps->dpy, pixmap);
|
||||
xcb_free_pixmap(c, pixmap);
|
||||
return None;
|
||||
}
|
||||
|
||||
|
@ -726,7 +726,7 @@ solid_picture(session_t *ps, bool argb, double a,
|
|||
rect.height = 1;
|
||||
|
||||
xcb_render_fill_rectangles(c, XCB_RENDER_PICT_OP_SRC, picture, col, 1, &rect);
|
||||
XFreePixmap(ps->dpy, pixmap);
|
||||
xcb_free_pixmap(c, pixmap);
|
||||
|
||||
return picture;
|
||||
}
|
||||
|
|
|
@ -60,11 +60,11 @@ xcb_composite_name_window_pixmap_(xcb_connection_t *c, xcb_window_t window, xcb_
|
|||
xcb_composite_name_window_pixmap_(dpy, window, pixmap, M_POS_DATA)
|
||||
|
||||
static inline void
|
||||
XFreePixmap_(Display *dpy, Pixmap pixmap, M_POS_DATA_PARAMS) {
|
||||
XFreePixmap(dpy, pixmap);
|
||||
xcb_free_pixmap_(xcb_connection_t *c, Pixmap pixmap, M_POS_DATA_PARAMS) {
|
||||
xcb_free_pixmap(c, pixmap);
|
||||
xrc_delete_xid_(pixmap, M_POS_DATA_PASSTHROUGH);
|
||||
}
|
||||
|
||||
#define XFreePixmap(dpy, pixmap) XFreePixmap_(dpy, pixmap, M_POS_DATA);
|
||||
#define xcb_free_pixmap(c, pixmap) xcb_free_pixmap_(c, pixmap, M_POS_DATA);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue