core: check experimental_backend before accessing backend_list
backend_list[backend] is only guaranteed to be non-NULL if experimental backends are used. Fixes #258 Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
44a771cf76
commit
30e9e2dc9f
12
src/picom.c
12
src/picom.c
|
@ -1161,9 +1161,15 @@ xcb_window_t session_get_target_window(session_t *ps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint8_t session_redirection_mode(session_t *ps) {
|
static inline uint8_t session_redirection_mode(session_t *ps) {
|
||||||
if (ps->o.debug_mode || !backend_list[ps->o.backend]->present) {
|
if (ps->o.debug_mode) {
|
||||||
// If the backend is not rendering to the screen, or if the backend
|
// If the backend is not rendering to the screen, we don't need to
|
||||||
// doesn't render anything, we don't need to take over the screen.
|
// take over the screen.
|
||||||
|
assert(ps->o.experimental_backends);
|
||||||
|
return XCB_COMPOSITE_REDIRECT_AUTOMATIC;
|
||||||
|
}
|
||||||
|
if (ps->o.experimental_backends && !backend_list[ps->o.backend]->present) {
|
||||||
|
// if the backend doesn't render anything, we don't need to take over the
|
||||||
|
// screen.
|
||||||
return XCB_COMPOSITE_REDIRECT_AUTOMATIC;
|
return XCB_COMPOSITE_REDIRECT_AUTOMATIC;
|
||||||
}
|
}
|
||||||
return XCB_COMPOSITE_REDIRECT_MANUAL;
|
return XCB_COMPOSITE_REDIRECT_MANUAL;
|
||||||
|
|
Loading…
Reference in New Issue