From 9ed1b985c5128d9eb66f69d377631e0506725466 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sat, 20 Apr 2019 15:55:26 +0100 Subject: [PATCH] core: don't try rebinding the window image when unredirected Signed-off-by: Yuxuan Shui --- src/compton.c | 4 +++- src/win.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compton.c b/src/compton.c index eaee459..4655d37 100644 --- a/src/compton.c +++ b/src/compton.c @@ -502,7 +502,8 @@ static struct managed_win *paint_preprocess(session_t *ps, bool *fade_running) { (w->flags & WIN_FLAGS_IMAGE_ERROR) == 0 && to_paint) { // Image needs to be updated, update it. w->flags &= ~WIN_FLAGS_IMAGE_STALE; - if (w->state != WSTATE_UNMAPPING && w->state != WSTATE_DESTROYING) { + if (w->state != WSTATE_UNMAPPING && + w->state != WSTATE_DESTROYING && ps->redirected) { // Rebind image only when the window does have an image // available if (!win_try_rebind_image(ps, w)) { @@ -705,6 +706,7 @@ static void destroy_backend(session_t *ps) { if (!w) { continue; } + if (ps->backend_data) { if (w->state == WSTATE_MAPPED) { win_release_image(ps->backend_data, w); diff --git a/src/win.c b/src/win.c index 5f3c992..31f08e5 100644 --- a/src/win.c +++ b/src/win.c @@ -193,6 +193,7 @@ void add_damage_from_win(session_t *ps, const struct managed_win *w) { /// Release the images attached to this window void win_release_image(backend_t *base, struct managed_win *w) { + log_debug("Releasing image of window %#010x (%s)", w->base.id, w->name); assert(w->win_image || (w->flags & WIN_FLAGS_IMAGE_ERROR)); if (w->win_image) { base->ops->release_image(base, w->win_image); @@ -218,7 +219,7 @@ _win_bind_image(session_t *ps, struct managed_win *w, void **win_image, void **s free(e); return false; } - log_trace("New named pixmap %#010x", pixmap); + log_trace("New named pixmap for %#010x (%s) : %#010x", w->base.id, w->name, pixmap); *win_image = ps->backend_data->ops->bind_pixmap( ps->backend_data, pixmap, x_get_visual_info(ps->c, w->a.visual), true); if (!*win_image) {