From cbfb417dce790dac833fcfcff7c4de05df547b65 Mon Sep 17 00:00:00 2001 From: Ashwin Date: Mon, 17 Oct 2022 20:55:55 +1100 Subject: [PATCH] option to turn off struts --- include/components/types.hpp | 1 + src/components/bar.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/components/types.hpp b/include/components/types.hpp index 1d453e1c..b22990c0 100644 --- a/include/components/types.hpp +++ b/include/components/types.hpp @@ -183,6 +183,7 @@ struct bar_settings { position offset{0, 0}; side_values padding{ZERO_SPACE, ZERO_SPACE}; side_values module_margin{ZERO_SPACE, ZERO_SPACE}; + bool struts{true}; struct { int top; int bottom; diff --git a/src/components/bar.cpp b/src/components/bar.cpp index 9186d31d..ceed29da 100644 --- a/src/components/bar.cpp +++ b/src/components/bar.cpp @@ -218,6 +218,8 @@ bar::bar(connection& conn, signal_emitter& emitter, const config& config, const m_opts.double_click_interval = m_conf.get(bs, "double-click-interval", m_opts.double_click_interval); + m_opts.struts = m_conf.get(bs, "enable-struts", m_opts.struts); + if (only_initialize_values) { return; } @@ -546,6 +548,16 @@ void bar::reconfigure_pos() { * Reconfigure window strut values */ void bar::reconfigure_struts() { + if (!m_opts.struts) { + if (m_conf.has("global/wm", "margin-bottom")) { + m_log.warn("Struts are disabled, ignoring margin-bottom"); + } + if (m_conf.has("global/wm", "margin-top")) { + m_log.warn("Struts are disabled, ignoring margin-top"); + } + return; + } + window win{m_connection, m_opts.window}; if (m_visible) { auto geom = m_connection.get_geometry(m_screen->root());