Skip to content

Commit

Permalink
win: make sure a mapped window always have a pixmap bound
Browse files Browse the repository at this point in the history
We used to only bind the pixmap when the window is damaged the first
time, because we assume before that, there is no meanful content, and we
don't render windows that haven't been damaged.

But, if a window is damaged then immediately unmapped, we won't have a
chance to bind the pixmap. If the window needs to be faded out, we will
be in a position where we need to render the window, but don't have its
pixmap.

Signed-off-by: Yuxuan Shui <[email protected]>
  • Loading branch information
yshui committed May 4, 2024
1 parent 2052bc7 commit 52bca36
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 0 additions & 4 deletions src/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,6 @@ static inline void repair_win(session_t *ps, struct managed_win *w) {
free(e);
}
win_extents(w, &parts);

// We only binds the window pixmap once the window is damaged.
win_set_flags(w, WIN_FLAGS_PIXMAP_STALE);
ps->pending_updates = true;
} else {
auto cookie = xcb_damage_subtract(ps->c.c, w->damage, XCB_NONE,
ps->damage_ring.x_region);
Expand Down
1 change: 1 addition & 0 deletions src/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -2350,6 +2350,7 @@ void map_win_start(session_t *ps, struct managed_win *w) {

w->state = WSTATE_MAPPED;
win_start_fade(ps, w, 1);
win_set_flags(w, WIN_FLAGS_PIXMAP_STALE);

log_debug("Window %#010x has opacity %f, opacity target is %f", w->base.id,
animatable_get(&w->opacity), w->opacity.target);
Expand Down

0 comments on commit 52bca36

Please sign in to comment.