1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

Port XCompositeUnredirect{Subw,W}indows to xcb

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2018-09-28 18:41:24 +02:00
parent 11204e7a44
commit 79089b0652

View file

@ -3680,6 +3680,7 @@ static bool
register_cm(session_t *ps) { register_cm(session_t *ps) {
assert(!ps->reg_win); assert(!ps->reg_win);
xcb_connection_t *c = XGetXCBConnection(ps->dpy);
ps->reg_win = XCreateSimpleWindow(ps->dpy, ps->root, 0, 0, 1, 1, 0, ps->reg_win = XCreateSimpleWindow(ps->dpy, ps->root, 0, 0, 1, 1, 0,
None, None); None, None);
@ -3690,7 +3691,7 @@ register_cm(session_t *ps) {
// Unredirect the window if it's redirected, just in case // Unredirect the window if it's redirected, just in case
if (ps->redirected) if (ps->redirected)
XCompositeUnredirectWindow(ps->dpy, ps->reg_win, CompositeRedirectManual); xcb_composite_unredirect_window(c, ps->reg_win, CompositeRedirectManual);
{ {
XClassHint *h = XAllocClassHint(); XClassHint *h = XAllocClassHint();
@ -4788,9 +4789,9 @@ redir_start(session_t *ps) {
/* /*
// Unredirect GL context window as this may have an effect on VSync: // Unredirect GL context window as this may have an effect on VSync:
// < http://dri.freedesktop.org/wiki/CompositeSwap > // < http://dri.freedesktop.org/wiki/CompositeSwap >
XCompositeUnredirectWindow(ps->dpy, ps->reg_win, CompositeRedirectManual); xcb_composite_unredirect_window(c, ps->reg_win, CompositeRedirectManual);
if (ps->o.paint_on_overlay && ps->overlay) { if (ps->o.paint_on_overlay && ps->overlay) {
XCompositeUnredirectWindow(ps->dpy, ps->overlay, xcb_composite_unredirect_window(c, ps->overlay,
CompositeRedirectManual); CompositeRedirectManual);
} */ } */
@ -4954,6 +4955,7 @@ timeout_reset(session_t *ps, timeout_t *ptmout) {
static void static void
redir_stop(session_t *ps) { redir_stop(session_t *ps) {
if (ps->redirected) { if (ps->redirected) {
xcb_connection_t *c = XGetXCBConnection(ps->dpy);
#ifdef DEBUG_REDIR #ifdef DEBUG_REDIR
print_timestamp(ps); print_timestamp(ps);
printf_dbgf("(): Screen unredirected.\n"); printf_dbgf("(): Screen unredirected.\n");
@ -4964,7 +4966,7 @@ redir_stop(session_t *ps) {
for (win *w = ps->list; w; w = w->next) for (win *w = ps->list; w; w = w->next)
free_wpaint(ps, w); free_wpaint(ps, w);
XCompositeUnredirectSubwindows(ps->dpy, ps->root, CompositeRedirectManual); xcb_composite_unredirect_subwindows(c, ps->root, CompositeRedirectManual);
// Unmap overlay window // Unmap overlay window
if (ps->overlay) if (ps->overlay)
XUnmapWindow(ps->dpy, ps->overlay); XUnmapWindow(ps->dpy, ps->overlay);