From 18485d00c2298474b45bb90aab24d4d3c6b662c7 Mon Sep 17 00:00:00 2001
From: patrick96
Date: Sun, 27 Feb 2022 20:30:23 +0100
Subject: [PATCH] Cleanup tray code
---
include/x11/tray_manager.hpp | 16 ++++----------
src/x11/tray_manager.cpp | 42 ++++++++----------------------------
2 files changed, 13 insertions(+), 45 deletions(-)
diff --git a/include/x11/tray_manager.hpp b/include/x11/tray_manager.hpp
index 471b233e..6abaf8ec 100644
--- a/include/x11/tray_manager.hpp
+++ b/include/x11/tray_manager.hpp
@@ -42,14 +42,10 @@ class bg_slice;
struct tray_settings {
alignment align{alignment::NONE};
bool running{false};
- int rel_x{0};
- int rel_y{0};
+
int orig_x{0};
int orig_y{0};
- int configured_x{0};
- int configured_y{0};
unsigned int configured_w{0U};
- unsigned int configured_h{0U};
unsigned int configured_slots{0U};
unsigned int width{0U};
unsigned int width_max{0U};
@@ -95,7 +91,7 @@ class tray_manager : public xpp::event::sink> m_clients;
tray_settings m_opts{};
+ const bar_settings& m_bar_opts;
xcb_gcontext_t m_gc{0};
xcb_pixmap_t m_pixmap{0};
unique_ptr m_surface;
unique_ptr m_context;
- unsigned int m_prevwidth{0U};
- unsigned int m_prevheight{0U};
-
xcb_atom_t m_atom{0};
xcb_window_t m_tray{0};
xcb_window_t m_othermanager{0};
@@ -171,8 +165,6 @@ class tray_manager : public xpp::event::sinkdata.data32[1]) {
- if (!is_embedded(evt->data.data32[2])) {
- process_docking_request(evt->data.data32[2]);
+ xcb_window_t win = evt->data.data32[2];
+ if (!is_embedded(win)) {
+ process_docking_request(win);
} else {
- auto win = evt->data.data32[2];
m_log.warn("Tray client %s already embedded, ignoring request...", m_connection.id(win));
}
}