Compositor detection
This commit is contained in:
parent
0e35c6acb0
commit
296cea499c
17
src/x11/x.c
17
src/x11/x.c
@ -135,6 +135,8 @@ static void x_win_round_corners(struct window_x11 *win, const int rad)
|
|||||||
|
|
||||||
void x_display_surface(cairo_surface_t *srf, struct window_x11 *win, const struct dimensions *dim)
|
void x_display_surface(cairo_surface_t *srf, struct window_x11 *win, const struct dimensions *dim)
|
||||||
{
|
{
|
||||||
|
char astr[sizeof("_NET_WM_CM_S") / sizeof(char) + 8];
|
||||||
|
|
||||||
x_win_move(win, dim->x, dim->y, dim->w, dim->h);
|
x_win_move(win, dim->x, dim->y, dim->w, dim->h);
|
||||||
cairo_xlib_surface_set_size(win->root_surface, dim->w, dim->h);
|
cairo_xlib_surface_set_size(win->root_surface, dim->w, dim->h);
|
||||||
|
|
||||||
@ -145,8 +147,21 @@ void x_display_surface(cairo_surface_t *srf, struct window_x11 *win, const struc
|
|||||||
cairo_paint(win->c_ctx);
|
cairo_paint(win->c_ctx);
|
||||||
cairo_show_page(win->c_ctx);
|
cairo_show_page(win->c_ctx);
|
||||||
|
|
||||||
if (settings.corner_radius != 0)
|
sprintf (astr, "_NET_WM_CM_S%i", win->cur_screen);
|
||||||
|
Atom cm_sel = XInternAtom (xctx.dpy, astr, true);
|
||||||
|
if (settings.corner_radius != 0 && XGetSelectionOwner(xctx.dpy, cm_sel) == None)
|
||||||
x_win_round_corners(win, dim->corner_radius);
|
x_win_round_corners(win, dim->corner_radius);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XRectangle rect = {
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.width = dim->w,
|
||||||
|
.height = dim->h };
|
||||||
|
XShapeCombineRectangles(xctx.dpy, win->xwin, ShapeBounding, 0, 0, &rect, 1, ShapeSet, 1);
|
||||||
|
XShapeSelectInput(xctx.dpy,
|
||||||
|
win->xwin, ShapeNotifyMask);
|
||||||
|
}
|
||||||
|
|
||||||
XFlush(xctx.dpy);
|
XFlush(xctx.dpy);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user