option to turn off struts

This commit is contained in:
Ashwin 2022-10-17 20:55:55 +11:00 committed by Patrick Ziegler
parent 31bdacb3d7
commit cbfb417dce
2 changed files with 13 additions and 0 deletions

View File

@ -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;

View File

@ -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());