From 66785aae995bfb38723d4da0c9da6d11cb0bdce4 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sat, 11 Aug 2018 13:54:51 -0400 Subject: [PATCH] Honor opacity prop if set If opacity prop is explicitly set on the window, active/inactive opacity shouldn't kick in. --- src/compton.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/compton.c b/src/compton.c index 9c3efbe..3604fcb 100644 --- a/src/compton.c +++ b/src/compton.c @@ -2377,19 +2377,21 @@ calc_opacity(session_t *ps, win *w) { opacity = 0; else { // Try obeying opacity property and window type opacity firstly - if (OPAQUE == (opacity = w->opacity_prop)) { + if(w->has_opacity_prop) + opacity = w->opacity_prop; + else { opacity = ps->o.wintype_opacity[w->window_type] * OPAQUE; - } - // Respect inactive_opacity in some cases - if (ps->o.inactive_opacity && false == w->focused - && (OPAQUE == opacity || ps->o.inactive_opacity_override)) { - opacity = ps->o.inactive_opacity; - } + // Respect inactive_opacity in some cases + if (ps->o.inactive_opacity && false == w->focused + && (OPAQUE == opacity || ps->o.inactive_opacity_override)) { + opacity = ps->o.inactive_opacity; + } - // Respect active_opacity only when the window is physically focused - if (OPAQUE == opacity && ps->o.active_opacity && win_is_focused_real(ps, w)) - opacity = ps->o.active_opacity; + // Respect active_opacity only when the window is physically focused + if (OPAQUE == opacity && ps->o.active_opacity && win_is_focused_real(ps, w)) + opacity = ps->o.active_opacity; + } } w->opacity_tgt = opacity;