diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f136205..545bfef6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -90,6 +90,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 windows per workspace ([`#604`](https://github.com/polybar/polybar/issues/604)) - `internal/backlight`: added `use-actual-brightness` option +- Added `wm-restack = generic` option that lowers polybar to the bottom of the stack. + Fixes the issue where the bar is being drawn on top of fullscreen windows in xmonad. + ([`#2205`](https://github.com/polybar/polybar/issues/2205)) ### Changed - Slight changes to the value ranges the different ramp levels are responsible diff --git a/config/config.cmake b/config/config.cmake index 5acd8ce9..a5472390 100644 --- a/config/config.cmake +++ b/config/config.cmake @@ -63,6 +63,7 @@ tray-position = right tray-padding = 2 ;tray-background = #0063ff +;wm-restack = generic ;wm-restack = bspwm ;wm-restack = i3 diff --git a/src/components/bar.cpp b/src/components/bar.cpp index 614f0f56..3abe7e43 100644 --- a/src/components/bar.cpp +++ b/src/components/bar.cpp @@ -458,7 +458,19 @@ void bar::restack_window() { auto restacked = false; - if (wm_restack == "bspwm") { + if (wm_restack == "generic") { + try { + auto children = m_connection.query_tree(m_connection.screen()->root).children(); + if (children.begin() != children.end() && *children.begin() != m_opts.window) { + const unsigned int value_mask = XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE; + const unsigned int value_list[2]{*children.begin(), XCB_STACK_MODE_BELOW}; + m_connection.configure_window_checked(m_opts.window, value_mask, value_list); + } + restacked = true; + } catch (const exception& err) { + m_log.err("Failed to restack bar window (err=%s)", err.what()); + } + } else if (wm_restack == "bspwm") { restacked = bspwm_util::restack_to_root(m_connection, m_opts.monitor, m_opts.window); #if ENABLE_I3 } else if (wm_restack == "i3" && m_opts.override_redirect) {