From 43f3744fea075e5fdc6e01a0e66a00b15833cddb Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sat, 22 Sep 2018 19:43:35 +0100 Subject: [PATCH] Revert "Workaround for what seems to be a race in Xserver" This reverts commit 967d9f32eaadb64961ec6638cc478ca3403b0329. --- src/compton.c | 11 ++++++++--- src/win.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/compton.c b/src/compton.c index 61ff40b0..d663e1c0 100644 --- a/src/compton.c +++ b/src/compton.c @@ -2089,7 +2089,7 @@ paint_all(session_t *ps, XserverRegion region, XserverRegion region_real, win *t } static void -repair_win(session_t *ps, win *w, XDamageNotifyEvent *de) { +repair_win(session_t *ps, win *w) { if (IsViewable != w->a.map_state) return; @@ -2097,8 +2097,12 @@ repair_win(session_t *ps, win *w, XDamageNotifyEvent *de) { if (!w->ever_damaged) { parts = win_extents(ps, w); + set_ignore_next(ps); + XDamageSubtract(ps->dpy, w->damage, None, None); } else { - parts = XFixesCreateRegion(ps->dpy, (XRectangle[]){de->area}, 1); + parts = XFixesCreateRegion(ps->dpy, 0, 0); + set_ignore_next(ps); + XDamageSubtract(ps->dpy, w->damage, None, parts); XFixesTranslateRegion(ps->dpy, parts, w->a.x + w->a.border_width, w->a.y + w->a.border_width); @@ -3225,7 +3229,7 @@ ev_damage_notify(session_t *ps, XDamageNotifyEvent *de) { if (!w) return; - repair_win(ps, w, de); + repair_win(ps, w); } inline static void @@ -5410,6 +5414,7 @@ session_init(session_t *ps_old, int argc, char **argv) { if (!ps->dpy) { printf_errfq(1, "(): Can't open display."); } + XSetEventQueueOwner(ps->dpy, XCBOwnsEventQueue); } XSetErrorHandler(xerror); diff --git a/src/win.c b/src/win.c index 54871e4a..59ebee55 100644 --- a/src/win.c +++ b/src/win.c @@ -878,7 +878,7 @@ bool add_win(session_t *ps, Window id, Window prev) { // Create Damage for window set_ignore_next(ps); - new->damage = XDamageCreate(ps->dpy, id, XDamageReportRawRectangles); + new->damage = XDamageCreate(ps->dpy, id, XDamageReportNonEmpty); } calc_win_size(ps, new);