From a23bac727cb7e5843a0499bc7451d8d1997ff2c8 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sat, 4 Apr 2020 15:55:30 +0100 Subject: [PATCH] new backend: assert blur_opacity is in [0, 1] Related to: #314 #318 Signed-off-by: Yuxuan Shui --- src/backend/backend.c | 1 + src/event.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/backend.c b/src/backend/backend.c index 3593919..bded608 100644 --- a/src/backend/backend.c +++ b/src/backend/backend.c @@ -215,6 +215,7 @@ void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) { blur_opacity = w->opacity / win_calc_opacity_target(ps, w, true); } + assert(blur_opacity >= 0 && blur_opacity <= 1); if (real_win_mode == WMODE_TRANS || ps->o.force_win_blend) { // We need to blur the bounding shape of the window diff --git a/src/event.c b/src/event.c index 89c06ef..f636703 100644 --- a/src/event.c +++ b/src/event.c @@ -11,10 +11,10 @@ #include "atom.h" #include "common.h" #include "compiler.h" -#include "picom.h" #include "config.h" #include "event.h" #include "log.h" +#include "picom.h" #include "region.h" #include "utils.h" #include "win.h"