win: split WIN_FLAGS_IMAGE_STALE

Split it into PIXMAP_STALE and SHADOW_STALE, this allows us to update
pixmaps and shadow images separately.

Also added PIXMAP_NONE and SHADOW_NONE, as redundancy to detect logic
errors.

Convenient constants and functions are provided for updating pixmap and
shadow together.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-09-19 18:48:12 +01:00
parent 1549997811
commit eecee130b8
5 changed files with 143 additions and 66 deletions

View File

@ -250,14 +250,14 @@ struct managed_win {
#endif
};
void win_release_image(struct backend_base *base, struct managed_win *w);
bool must_use win_bind_image(session_t *ps, struct managed_win *w);
/// Process pending images flags on a window. Has to be called in X critical section
void win_process_flags(session_t *ps, struct managed_win *w);
/// Attempt a rebind of window's images. If that failed, the original images are kept.
bool must_use win_try_rebind_image(session_t *ps, struct managed_win *w);
/// Release images bound with a window, set the *_NONE flags on the window. Only to be
/// used when de-initializing the backend outside of win.c
void win_release_images(struct backend_base *base, struct managed_win *w);
void win_bind_image(struct backend_base *backend, struct managed_win *w, struct color c,
struct conv *kernel);
int win_get_name(session_t *ps, struct managed_win *w);
int win_get_role(session_t *ps, struct managed_win *w);
winmode_t attr_pure win_calc_mode(const struct managed_win *w);