core: don't try rebinding the window image when unredirected

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-04-20 15:55:26 +01:00
parent efe63f5380
commit 9ed1b985c5
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
2 changed files with 5 additions and 2 deletions

View File

@ -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);

View File

@ -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) {