fix(tray): Put tray above bar in the window stack

Closes jaagr/lemonbuddy#94
This commit is contained in:
Michael Carlberg 2016-10-15 13:59:16 +02:00
parent dc82d0ed57
commit bcd1774370
3 changed files with 12 additions and 0 deletions

View File

@ -465,6 +465,8 @@ class bar : public xpp::event::sink<evt::button_press, evt::expose> {
m_tray.orig_x = m_bar.x + m_borders.at(border::LEFT).size;
}
m_tray.sibling = m_window;
// }}}
// Connect signal handlers {{{

View File

@ -71,6 +71,7 @@ struct tray_settings {
height = o.height;
spacing = o.spacing;
slots = o.slots;
sibling = o.sibling;
return *this;
}
@ -82,6 +83,7 @@ struct tray_settings {
uint16_t height{0};
uint16_t spacing{0};
uint16_t slots{0};
uint32_t sibling;
};
struct border_settings {

View File

@ -324,6 +324,14 @@ class traymanager
m_connection.create_window_checked(scr->root_depth, m_tray, scr->root, x, y,
m_settings.width + m_settings.spacing * 2, m_settings.height + m_settings.spacing * 2, 0,
XCB_WINDOW_CLASS_INPUT_OUTPUT, scr->root_visual, mask, values);
// Put the tray window above the defined sibling in the window stack
if (m_settings.sibling != XCB_NONE) {
const uint32_t value_mask = XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE;
const uint32_t value_list[2]{m_settings.sibling, XCB_STACK_MODE_ABOVE};
m_connection.configure_window_checked(m_tray, value_mask, value_list);
m_connection.flush();
}
}
/**