Fix handling of region == NULL in paint_all_new
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
5a1975909a
commit
99b3c4575f
|
@ -18,23 +18,30 @@ bool default_is_frame_transparent(void *backend_data, win *w, void *win_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// paint all windows
|
/// paint all windows
|
||||||
void paint_all_new(session_t *ps, region_t *region, win *const t) {
|
void paint_all_new(session_t *ps, region_t *_region, win *const t) {
|
||||||
auto bi = backend_list[ps->o.backend];
|
auto bi = backend_list[ps->o.backend];
|
||||||
assert(bi);
|
assert(bi);
|
||||||
|
|
||||||
|
const region_t *region;
|
||||||
|
if (!_region) {
|
||||||
|
region = &ps->screen_reg;
|
||||||
|
} else {
|
||||||
|
// Ignore out-of-screen damages
|
||||||
|
pixman_region32_intersect(_region, _region, &ps->screen_reg);
|
||||||
|
region = _region;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_REPAINT
|
#ifdef DEBUG_REPAINT
|
||||||
static struct timespec last_paint = {0};
|
static struct timespec last_paint = {0};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Ignore out-of-screen damages
|
region_t reg_tmp;
|
||||||
pixman_region32_intersect(region, region, &ps->screen_reg);
|
const region_t *reg_paint;
|
||||||
|
|
||||||
region_t reg_tmp, *reg_paint;
|
|
||||||
pixman_region32_init(®_tmp);
|
pixman_region32_init(®_tmp);
|
||||||
if (t) {
|
if (t) {
|
||||||
// Calculate the region upon which the root window (wallpaper) is to be
|
// Calculate the region upon which the root window (wallpaper) is to be
|
||||||
// painted based on the ignore region of the lowest window, if available
|
// painted based on the ignore region of the lowest window, if available
|
||||||
pixman_region32_subtract(®_tmp, region, t->reg_ignore);
|
pixman_region32_subtract(®_tmp, (region_t *)region, t->reg_ignore);
|
||||||
reg_paint = ®_tmp;
|
reg_paint = ®_tmp;
|
||||||
} else {
|
} else {
|
||||||
reg_paint = region;
|
reg_paint = region;
|
||||||
|
@ -52,7 +59,7 @@ void paint_all_new(session_t *ps, region_t *region, win *const t) {
|
||||||
// Calculate the region based on the reg_ignore of the next (higher)
|
// Calculate the region based on the reg_ignore of the next (higher)
|
||||||
// window and the bounding region
|
// window and the bounding region
|
||||||
// XXX XXX
|
// XXX XXX
|
||||||
pixman_region32_subtract(®_tmp, region, w->reg_ignore);
|
pixman_region32_subtract(®_tmp, (region_t *)region, w->reg_ignore);
|
||||||
|
|
||||||
if (pixman_region32_not_empty(®_tmp)) {
|
if (pixman_region32_not_empty(®_tmp)) {
|
||||||
// Render window content
|
// Render window content
|
||||||
|
|
|
@ -244,5 +244,3 @@ shadow_picture_err:
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim: set noet sw=8 ts=8 :
|
|
||||||
|
|
Loading…
Reference in New Issue