refactor: Rename dock to override-redirect

This commit is contained in:
Michael Carlberg 2016-12-03 23:08:47 +01:00
parent d6a0c84e0b
commit 9f16e3fff7
3 changed files with 12 additions and 6 deletions

View File

@ -101,7 +101,7 @@ struct bar_settings {
string wmname;
string locale;
bool force_docking{false};
bool override_redirect{false};
const xcb_rectangle_t inner_area(bool abspos = false) const {
xcb_rectangle_t rect{0, 0, size.w, size.h};

View File

@ -77,7 +77,13 @@ void bar::bootstrap(bool nodraw) {
m_opts.origin = edge::BOTTOM;
}
GET_CONFIG_VALUE(bs, m_opts.force_docking, "dock");
try {
m_opts.override_redirect = m_conf.get<bool>(bs, "dock");
m_conf.warn_deprecated(bs, "dock", "override-redirect");
} catch (const key_error& err) {
m_opts.override_redirect = m_conf.get<bool>(bs, "override-redirect", m_opts.override_redirect);
}
GET_CONFIG_VALUE(bs, m_opts.spacing, "spacing");
GET_CONFIG_VALUE(bs, m_opts.padding.left, "padding-left");
GET_CONFIG_VALUE(bs, m_opts.padding.right, "padding-right");
@ -503,10 +509,10 @@ void bar::restack_window() {
if (wm_restack == "bspwm") {
restacked = bspwm_util::restack_above_root(m_connection, m_opts.monitor, m_window);
#if ENABLE_I3
} else if (wm_restack == "i3" && m_opts.force_docking) {
} else if (wm_restack == "i3" && m_opts.override_redirect) {
restacked = i3_util::restack_above_root(m_connection, m_opts.monitor, m_window);
} else if (wm_restack == "i3" && !m_opts.force_docking) {
m_log.warn("Ignoring restack of i3 window (not needed when dock = false)");
} else if (wm_restack == "i3" && !m_opts.override_redirect) {
m_log.warn("Ignoring restack of i3 window (not needed when `override-redirect = false`)");
wm_restack.clear();
#endif
} else {

View File

@ -57,7 +57,7 @@ renderer::renderer(connection& conn, const logger& logger, unique_ptr<font_manag
<< cw_params_event_mask(XCB_EVENT_MASK_PROPERTY_CHANGE
|XCB_EVENT_MASK_EXPOSURE
|XCB_EVENT_MASK_BUTTON_PRESS)
<< cw_params_override_redirect(m_bar.force_docking)
<< cw_params_override_redirect(m_bar.override_redirect)
<< cw_flush(true);
// clang-format on
}