1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-18 13:55:11 -05:00

tray: Set _NET_SYSTEM_TRAY_VISUAL

This commit is contained in:
patrick96 2022-09-26 21:39:10 +02:00
parent 5c38d5cb17
commit def2682b8c
No known key found for this signature in database
GPG key ID: 521E5E03AEBCA1A7
4 changed files with 12 additions and 0 deletions

View file

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

View file

@ -374,6 +374,7 @@ void renderer::flush() {
m_surface->flush(); m_surface->flush();
m_connection.clear_area(0, m_window, 0, 0, m_bar.size.w, m_bar.size.h); m_connection.clear_area(0, m_window, 0, 0, m_bar.size.w, m_bar.size.h);
// TODO
// m_connection.copy_area(m_pixmap, m_window, m_gcontext, 0, 0, 0, 0, m_bar.size.w, m_bar.size.h); // m_connection.copy_area(m_pixmap, m_window, m_gcontext, 0, 0, 0, 0, m_bar.size.w, m_bar.size.h);
m_connection.flush(); m_connection.flush();

View file

@ -82,6 +82,7 @@ unsigned int tray_client::height() const {
} }
void tray_client::clear_window() const { void tray_client::clear_window() const {
m_connection.clear_area_checked(1, embedder(), 0, 0, width(), height());
m_connection.clear_area_checked(1, client(), 0, 0, width(), height()); m_connection.clear_area_checked(1, client(), 0, 0, width(), height());
} }

View file

@ -132,6 +132,7 @@ void tray_manager::activate() {
try { try {
set_tray_colors(); set_tray_colors();
set_tray_orientation(); set_tray_orientation();
set_tray_visual();
} catch (const exception& err) { } catch (const exception& err) {
m_log.err(err.what()); m_log.err(err.what());
m_log.err("Cannot activate tray manager... failed to setup window"); m_log.err("Cannot activate tray manager... failed to setup window");
@ -370,6 +371,14 @@ void tray_manager::set_tray_orientation() {
XCB_ATOM_CARDINAL, 32, 1, &orientation); XCB_ATOM_CARDINAL, 32, 1, &orientation);
} }
void tray_manager::set_tray_visual() {
// TODO use bar visual
const uint32_t visualid = m_connection.visual_type(XCB_VISUAL_CLASS_TRUE_COLOR, 32)->visual_id;
m_log.trace("tray: Set _NET_SYSTEM_TRAY_VISUAL to 0x%x", visualid);
m_connection.change_property_checked(
XCB_PROP_MODE_REPLACE, m_opts.selection_owner, _NET_SYSTEM_TRAY_VISUAL, XCB_ATOM_VISUALID, 32, 1, &visualid);
}
/** /**
* Acquire the systray selection * Acquire the systray selection
* *