From 23153c3a234cb3de5f46132299bfabd8094cfff3 Mon Sep 17 00:00:00 2001
From: patrick96
Date: Sat, 25 Mar 2023 19:19:09 +0100
Subject: [PATCH] tray: Address rendering related TODOs
Currently, we don't support 32-bit visuals and don't set
_NET_SYSTEM_TRAY_VISUAL
It is unclear what happens if the default visual (which is used as a
fallback if _NET_SYSTEM_TRAY_VISUAL is not set) is 32-bit.
In that case, we may need to explicitly use a 24-bit visual.
---
src/x11/tray_client.cpp | 10 ----------
src/x11/tray_manager.cpp | 11 -----------
2 files changed, 21 deletions(-)
diff --git a/src/x11/tray_client.cpp b/src/x11/tray_client.cpp
index 5baf20d0..3ff15f22 100644
--- a/src/x11/tray_client.cpp
+++ b/src/x11/tray_client.cpp
@@ -21,16 +21,6 @@ namespace tray {
*
* True transprency is currently not supported here because it cannot be achieved with external compositors (those only
* seem to work for top-level windows) and has to be implemented by hand.
- *
- * TODO proper background of wrapper window:
- *
- * (TODO: Check if this is still necessary, the current approach seems to work)
- *
- * Do first possible:
- *
- * 1. Use PARENT_RELATIVE if tray window depths, etc. matches the bar window
- * 2. Use pseudo-transparency when activated (make sure the depths match)
- * 3. Use background color
*/
client::client(
const logger& log, connection& conn, xcb_window_t parent, xcb_window_t win, size s, rgba desired_background)
diff --git a/src/x11/tray_manager.cpp b/src/x11/tray_manager.cpp
index 9f8d2d26..d608938d 100644
--- a/src/x11/tray_manager.cpp
+++ b/src/x11/tray_manager.cpp
@@ -119,8 +119,6 @@ void manager::activate() {
try {
set_tray_colors();
set_tray_orientation();
- // TODO
- // set_tray_visual();
} catch (const exception& err) {
m_log.err(err.what());
m_log.err("Cannot activate tray manager... failed to setup window");
@@ -351,15 +349,6 @@ void manager::set_tray_orientation() {
XCB_ATOM_CARDINAL, 32, 1, &orientation);
}
-// TODO remove, we should probably not set a visual at all (or only a 24-bit one)
-void 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
*