From 59c0ccef50c59b63e60d69685d90c7490a415380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benno=20F=C3=BCnfst=C3=BCck?= Date: Thu, 5 Jul 2018 21:03:48 +0200 Subject: [PATCH] fix(tray): remove tray-transparent option This option is no longer necessary because the tray background color can now simply be set to any (semi-)transparent color (just like the bar background). --- doc/config.cmake | 1 - src/x11/tray_manager.cpp | 27 ++++++++------------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/doc/config.cmake b/doc/config.cmake index a110d970..ed865628 100644 --- a/doc/config.cmake +++ b/doc/config.cmake @@ -61,7 +61,6 @@ modules-right = @MODULES_RIGHT@ tray-position = right tray-padding = 2 -;tray-transparent = true ;tray-background = #0063ff ;wm-restack = bspwm diff --git a/src/x11/tray_manager.cpp b/src/x11/tray_manager.cpp index 89059883..5825a7e4 100644 --- a/src/x11/tray_manager.cpp +++ b/src/x11/tray_manager.cpp @@ -121,23 +121,16 @@ void tray_manager::setup(const bar_settings& bar_opts) { } // Set user-defined background color - if (!(m_opts.transparent = conf.get(bs, "tray-transparent", m_opts.transparent))) { - auto bg = conf.get(bs, "tray-background", ""s); + auto bg = conf.get(bs, "tray-background", ""s); - if (bg.length() > 7) { - m_log.warn("Alpha support for the systray is limited. See the wiki for more details."); - } + if (!bg.empty()) { + m_opts.background = color_util::parse(bg); + } else { + m_opts.background = bar_opts.background; + } - if (!bg.empty()) { - m_opts.background = color_util::parse(bg); - } else { - m_opts.background = bar_opts.background; - } - - if (color_util::alpha_channel(m_opts.background) != 1) { - m_opts.transparent = true; - //m_opts.background = 0; - } + if (color_util::alpha_channel(m_opts.background) != 1) { + m_opts.transparent = true; } // Add user-defined padding @@ -211,10 +204,6 @@ void tray_manager::activate() { return; } - // Make sure we receive notificatins when the root pixmap changes - m_connection.ensure_event_mask(m_connection.root(), XCB_EVENT_MASK_PROPERTY_CHANGE); - m_connection.flush(); - // Attempt to get control of the systray selection then // notify clients waiting for a manager. acquire_selection();