From a1d30ddee37e0b4f5f2f382ee969a64cbdde487b Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Fri, 4 Nov 2016 20:23:14 +0100 Subject: [PATCH] feat: Configurable _NET_WM_STRUT_PARTIAL Bspwm just released support for _NET_WM_STRUT_PARTIAL which can be used to fix the workspace padding New config section: [global/wm] margin-top = 5 margin-bottom = 5 margin-left = 5 margin-right = 5 --- src/components/bar.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/bar.cpp b/src/components/bar.cpp index e947fae3..f77aa4f6 100644 --- a/src/components/bar.cpp +++ b/src/components/bar.cpp @@ -245,14 +245,19 @@ void bar::bootstrap(bool nodraw) { // {{{ uint32_t none{0}; uint32_t value_list[12]{none}; + auto mt = m_conf.get("global/wm", "margin-top", 0); + auto mb = m_conf.get("global/wm", "margin-bottom", 0); + auto ml = m_conf.get("global/wm", "margin-left", 0); + auto mr = m_conf.get("global/wm", "margin-right", 0); + if (m_bar.bottom) { - value_list[3] = m_bar.height; - value_list[10] = m_bar.x; - value_list[11] = m_bar.x + m_bar.width; + value_list[3] = m_bar.height + mt; + value_list[10] = m_bar.x + ml; + value_list[11] = m_bar.x + m_bar.width + mr; } else { - value_list[2] = m_bar.height; - value_list[8] = m_bar.x; - value_list[9] = m_bar.x + m_bar.width; + value_list[2] = m_bar.height + mb; + value_list[8] = m_bar.x + ml; + value_list[9] = m_bar.x + m_bar.width + mr; } m_connection.change_property(XCB_PROP_MODE_REPLACE, m_window, _NET_WM_STRUT_PARTIAL,