Skip to content

Commit

Permalink
wm/win: fix window pixmap stale check
Browse files Browse the repository at this point in the history
It was accidentally removed in 8065c1f,
causing window pixmaps to be rebound every render, slowing things down.

Fixes: #1368

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
  • Loading branch information
yshui committed Oct 17, 2024
1 parent 01b6766 commit 88480bd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/wm/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,15 @@ void win_process_image_flags(session_t *ps, struct win *w) {
// Assert that the MAPPED flag is already handled.
assert(!win_check_flags_all(w, WIN_FLAGS_MAPPED));

if (w->state != WSTATE_MAPPED) {
// Flags of invisible windows are processed when they are mapped
if (w->state != WSTATE_MAPPED || !win_check_flags_any(w, WIN_FLAGS_PIXMAP_STALE)) {
// 1. Flags of invisible windows are processed when they are mapped
// 2. We don't need to update window image if pixmap is not stale
return;
}

if (win_check_flags_all(w, WIN_FLAGS_PIXMAP_ERROR)) {
// We have previously failed to bind the pixmap, don't try again.
win_clear_flags(w, WIN_FLAGS_PIXMAP_STALE);
return;
}

Expand Down

0 comments on commit 88480bd

Please sign in to comment.