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
This commit is contained in:
Michael Carlberg 2016-11-04 20:23:14 +01:00
parent 7d2e8adf59
commit a1d30ddee3

View File

@ -245,14 +245,19 @@ void bar::bootstrap(bool nodraw) { // {{{
uint32_t none{0}; uint32_t none{0};
uint32_t value_list[12]{none}; uint32_t value_list[12]{none};
auto mt = m_conf.get<int>("global/wm", "margin-top", 0);
auto mb = m_conf.get<int>("global/wm", "margin-bottom", 0);
auto ml = m_conf.get<int>("global/wm", "margin-left", 0);
auto mr = m_conf.get<int>("global/wm", "margin-right", 0);
if (m_bar.bottom) { if (m_bar.bottom) {
value_list[3] = m_bar.height; value_list[3] = m_bar.height + mt;
value_list[10] = m_bar.x; value_list[10] = m_bar.x + ml;
value_list[11] = m_bar.x + m_bar.width; value_list[11] = m_bar.x + m_bar.width + mr;
} else { } else {
value_list[2] = m_bar.height; value_list[2] = m_bar.height + mb;
value_list[8] = m_bar.x; value_list[8] = m_bar.x + ml;
value_list[9] = m_bar.x + m_bar.width; value_list[9] = m_bar.x + m_bar.width + mr;
} }
m_connection.change_property(XCB_PROP_MODE_REPLACE, m_window, _NET_WM_STRUT_PARTIAL, m_connection.change_property(XCB_PROP_MODE_REPLACE, m_window, _NET_WM_STRUT_PARTIAL,