refactor: Rename restack function
This commit is contained in:
parent
2ebaa0fb5f
commit
796cdb52cc
@ -25,7 +25,7 @@ namespace bspwm_util {
|
||||
};
|
||||
|
||||
vector<xcb_window_t> root_windows(connection& conn);
|
||||
bool restack_above_root(connection& conn, const monitor_t& mon, const xcb_window_t win);
|
||||
bool restack_to_root(connection& conn, const monitor_t& mon, const xcb_window_t win);
|
||||
|
||||
string get_socket_path();
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace i3_util {
|
||||
shared_ptr<workspace_t> focused_workspace(const connection_t&);
|
||||
|
||||
vector<xcb_window_t> root_windows(connection& conn, const string& output_name = "");
|
||||
bool restack_above_root(connection& conn, const monitor_t& mon, const xcb_window_t win);
|
||||
bool restack_to_root(connection& conn, const monitor_t& mon, const xcb_window_t win);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
@ -366,10 +366,10 @@ void bar::restack_window() {
|
||||
auto restacked = false;
|
||||
|
||||
if (wm_restack == "bspwm") {
|
||||
restacked = bspwm_util::restack_above_root(m_connection, m_opts.monitor, m_opts.window);
|
||||
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) {
|
||||
restacked = i3_util::restack_above_root(m_connection, m_opts.monitor, m_opts.window);
|
||||
restacked = i3_util::restack_to_root(m_connection, m_opts.monitor, m_opts.window);
|
||||
} 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();
|
||||
|
@ -34,12 +34,12 @@ namespace bspwm_util {
|
||||
}
|
||||
|
||||
/**
|
||||
* Restack given window above the bspwm root window
|
||||
* Restack given window relative to the bspwm root window
|
||||
* for the given monitor.
|
||||
*
|
||||
* Fixes the issue with always-on-top window's
|
||||
*/
|
||||
bool restack_above_root(connection& conn, const monitor_t& mon, const xcb_window_t win) {
|
||||
bool restack_to_root(connection& conn, const monitor_t& mon, const xcb_window_t win) {
|
||||
for (auto&& root : root_windows(conn)) {
|
||||
auto geom = conn.get_geometry(root);
|
||||
|
||||
|
@ -55,12 +55,12 @@ namespace i3_util {
|
||||
}
|
||||
|
||||
/**
|
||||
* Restack given window above the i3 root window
|
||||
* Restack given window relative to the i3 root window
|
||||
* defined for the given monitor
|
||||
*
|
||||
* Fixes the issue with always-on-top window's
|
||||
*/
|
||||
bool restack_above_root(connection& conn, const monitor_t& mon, const xcb_window_t win) {
|
||||
bool restack_to_root(connection& conn, const monitor_t& mon, const xcb_window_t win) {
|
||||
for (auto&& root : root_windows(conn, mon->name)) {
|
||||
const uint32_t value_mask = XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE;
|
||||
const uint32_t value_list[2]{root, XCB_STACK_MODE_BELOW};
|
||||
|
Loading…
Reference in New Issue
Block a user