From cbfb417dce790dac833fcfcff7c4de05df547b65 Mon Sep 17 00:00:00 2001 From: Ashwin Date: Mon, 17 Oct 2022 20:55:55 +1100 Subject: [PATCH 1/8] 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()); From cbf5439e80a1bd25d460c236fa93bf585314d135 Mon Sep 17 00:00:00 2001 From: Ashwin Date: Mon, 17 Oct 2022 21:22:22 +1100 Subject: [PATCH 2/8] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98aea186..62b054ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `internal/backlight`: `scroll-interval` option ([`#2696`](https://github.com/polybar/polybar/issues/2696), [`#2700`](https://github.com/polybar/polybar/pull/2700)) - `internal/temperature`: Added `zone-type` setting ([`#2572`](https://github.com/polybar/polybar/issues/2572), [`#2752`](https://github.com/polybar/polybar/pull/2752)) by [@xphoniex](https://github.com/xphoniex) - `internal/xwindow`: `%class%` and `%instance%` tokens, which show the contents of the `WM_CLASS` property of the active window ([`#2830`](https://github.com/polybar/polybar/pull/2830)) +- Added `enable-struts` option in bar section to enable/disable struts ([`#2769`](https://github.com/polybar/polybar/issues/2769), [`#2844`](https://github.com/polybar/polybar/pull/2844)) by [@VanillaViking](https://github.com/VanillaViking). ### Changed - `internal/fs`: Use `/` as a fallback if no mountpoints are specified ([`#2572`](https://github.com/polybar/polybar/issues/2572), [`#2705`](https://github.com/polybar/polybar/pull/2705)) From 1e582accb87240525c6087d882e7d84bf66a8f8d Mon Sep 17 00:00:00 2001 From: Ashwin Date: Tue, 18 Oct 2022 08:49:24 +1100 Subject: [PATCH 3/8] moved warnings near config options --- src/components/bar.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/bar.cpp b/src/components/bar.cpp index ceed29da..e35f9399 100644 --- a/src/components/bar.cpp +++ b/src/components/bar.cpp @@ -225,6 +225,15 @@ bar::bar(connection& conn, signal_emitter& emitter, const config& config, const } // Load values used to adjust the struts atom + + 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"); + } + } auto margin_top = m_conf.get("global/wm", "margin-top", percentage_with_offset{}); auto margin_bottom = m_conf.get("global/wm", "margin-bottom", percentage_with_offset{}); m_opts.strut.top = units_utils::percentage_with_offset_to_pixel(margin_top, m_opts.monitor->h, m_opts.dpi_y); @@ -549,12 +558,6 @@ void bar::reconfigure_pos() { */ 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; } From 30e1cc259565ec61795de9b8adeb47476e242132 Mon Sep 17 00:00:00 2001 From: Madhav Prabhu C M <59736487+madhavpcm@users.noreply.github.com> Date: Sun, 23 Oct 2022 14:17:22 +0530 Subject: [PATCH 4/8] feat(ipc):