From 268e1d890ab7d982cbcbec034c3ccebd09c8b10b Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sun, 17 Dec 2023 23:34:34 +0000 Subject: [PATCH] core: exit if paint_preprocess fails This usually means there is another compositor running. If we don't do this picom will spin forever. Fixes #1104 Signed-off-by: Yuxuan Shui --- src/picom.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/picom.c b/src/picom.c index 1302f514..fa9182bf 100644 --- a/src/picom.c +++ b/src/picom.c @@ -1741,6 +1741,11 @@ static void draw_callback_impl(EV_P_ session_t *ps, int revents attr_unused) { auto bottom = paint_preprocess(ps, &fade_running, &animation); ps->tmout_unredir_hit = false; + if (!bottom) { + log_fatal("Pre-render preparation has failed, exiting..."); + exit(1); + } + if (!was_redirected && ps->redirected) { // paint_preprocess redirected the screen, which might change the state of // some of the windows (e.g. the window image might become stale).