From 9a927726170bcfed0fc078617b464efc0d0df118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benno=20F=C3=BCnfst=C3=BCck?= Date: Wed, 15 Aug 2018 15:46:26 +0200 Subject: [PATCH] fix(renderer): default m_comp_bg to OVER if pseudo-transparent --- src/components/renderer.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/renderer.cpp b/src/components/renderer.cpp index 1522660a..22f4d3a5 100644 --- a/src/components/renderer.cpp +++ b/src/components/renderer.cpp @@ -169,13 +169,19 @@ renderer::renderer( m_background.activate(m_window, m_bar.outer_area(false)); } - m_comp_bg = m_conf.get("settings", "compositing-background", m_comp_bg); + m_pseudo_transparency = m_conf.get("settings", "pseudo-transparency", m_pseudo_transparency); + + // if we use pseudo-transparency, CAIRO_OPERATOR_SOURCE makes no sense as default + auto m_comp_bg_default = m_pseudo_transparency ? CAIRO_OPERATOR_OVER : m_comp_bg; + m_comp_bg = m_conf.get("settings", "compositing-background", m_comp_bg_default); m_comp_fg = m_conf.get("settings", "compositing-foreground", m_comp_fg); m_comp_ol = m_conf.get("settings", "compositing-overline", m_comp_ol); m_comp_ul = m_conf.get("settings", "compositing-underline", m_comp_ul); m_comp_border = m_conf.get("settings", "compositing-border", m_comp_border); - m_pseudo_transparency = m_conf.get("settings", "pseudo-transparency", m_pseudo_transparency); + if (m_comp_bg == CAIRO_OPERATOR_SOURCE && m_pseudo_transparency) { + m_log.warn("pseudo-transparency may not work correctly with settings.compositing-background = source"); + } m_fixedcenter = m_conf.get(m_conf.section(), "fixed-center", true); }