From 7018357e47d6fb090372e9b4f147aaaff7581b01 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Thu, 24 Nov 2016 23:57:25 +0100 Subject: [PATCH] fix(tray): Add compton atom to exclude shadow --- include/x11/xutils.hpp | 2 ++ src/x11/tray.cpp | 2 ++ src/x11/xutils.cpp | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/include/x11/xutils.hpp b/include/x11/xutils.hpp index 26d1e774..49b7ab86 100644 --- a/include/x11/xutils.hpp +++ b/include/x11/xutils.hpp @@ -18,6 +18,8 @@ namespace xutils { void pack_values(uint32_t mask, const xcb_params_configure_window_t* src, uint32_t* dest); void visibility_notify(connection& conn, const xcb_window_t& win, xcb_visibility_t state); + + void compton_shadow_exclude(connection& conn, const xcb_window_t& win); } POLYBAR_NS_END diff --git a/src/x11/tray.cpp b/src/x11/tray.cpp index 9a02f3b3..bc6c99df 100644 --- a/src/x11/tray.cpp +++ b/src/x11/tray.cpp @@ -527,6 +527,8 @@ void tray_manager::create_window() { // {{{ m_connection.create_window_checked( scr->root_depth, m_tray, scr->root, x, y, w, h, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, scr->root_visual, mask, values); + + xutils::compton_shadow_exclude(m_connection, m_tray); } // }}} /** diff --git a/src/x11/xutils.cpp b/src/x11/xutils.cpp index 018c8eff..99b72bd5 100644 --- a/src/x11/xutils.cpp +++ b/src/x11/xutils.cpp @@ -1,3 +1,4 @@ +#include "x11/atoms.hpp" #include "x11/xutils.hpp" #include "x11/connection.hpp" #include "x11/xlib.hpp" @@ -45,6 +46,11 @@ namespace xutils { const char* data = reinterpret_cast(notify.get()); conn.send_event(true, win, XCB_EVENT_MASK_NO_EVENT, data); } + + void compton_shadow_exclude(connection& conn, const xcb_window_t& win) { + const uint32_t shadow = 0; + conn.change_property(XCB_PROP_MODE_REPLACE, win, _COMPTON_SHADOW, XCB_ATOM_CARDINAL, 32, 1, &shadow); + } } POLYBAR_NS_END