From 1e582accb87240525c6087d882e7d84bf66a8f8d Mon Sep 17 00:00:00 2001 From: Ashwin Date: Tue, 18 Oct 2022 08:49:24 +1100 Subject: [PATCH] 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; }