tray: Set _NET_SYSTEM_TRAY_ORIENTATION

This commit is contained in:
patrick96 2022-09-19 21:23:22 +02:00
parent 63c6b13cbf
commit 627d43dad2
No known key found for this signature in database
GPG Key ID: 521E5E03AEBCA1A7
3 changed files with 13 additions and 1 deletions

View File

@ -91,6 +91,7 @@ class tray_manager : public xpp::event::sink<evt::expose, evt::client_message, e
void query_atom();
void set_tray_colors();
void set_tray_orientation();
bool acquire_selection(xcb_window_t& other_owner);
void notify_clients();

View File

@ -57,7 +57,7 @@ renderer::renderer(connection& conn, signal_emitter& sig, const config& conf, co
throw application_error("Could not find a 24 or 32-bit TrueColor visual");
}
m_log.info("renderer: Using %d-bit TrueColor visual", m_depth);
m_log.info("renderer: Using %d-bit TrueColor visual: 0x%x", m_depth, m_visual->visual_id);
m_log.trace("renderer: Allocate colormap");
m_colormap = m_connection.generate_id();

View File

@ -131,6 +131,7 @@ void tray_manager::activate() {
try {
set_tray_colors();
set_tray_orientation();
} catch (const exception& err) {
m_log.err(err.what());
m_log.err("Cannot activate tray manager... failed to setup window");
@ -350,6 +351,16 @@ void tray_manager::set_tray_colors() {
XCB_PROP_MODE_REPLACE, m_opts.selection_owner, _NET_SYSTEM_TRAY_COLORS, XCB_ATOM_CARDINAL, 32, 12, colors);
}
/**
* Set the _NET_SYSTEM_TRAY_ORIENTATION atom
*/
void tray_manager::set_tray_orientation() {
const uint32_t orientation = _NET_SYSTEM_TRAY_ORIENTATION_HORZ;
m_log.trace("tray: Set _NET_SYSTEM_TRAY_ORIENTATION to 0x%x", orientation);
m_connection.change_property_checked(XCB_PROP_MODE_REPLACE, m_opts.selection_owner, _NET_SYSTEM_TRAY_ORIENTATION,
XCB_ATOM_CARDINAL, 32, 1, &orientation);
}
/**
* Acquire the systray selection
*