From 6a43758b5bd5ab86acb33d5f4cc1d68db0c6f589 Mon Sep 17 00:00:00 2001 From: raffael0 <43984260+raffael0@users.noreply.github.com> Date: Tue, 14 Jun 2022 15:35:49 +0200 Subject: [PATCH] tray is no longer pushed off the bar (#2727) --- src/x11/tray_manager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/x11/tray_manager.cpp b/src/x11/tray_manager.cpp index 55f37348..6d270563 100644 --- a/src/x11/tray_manager.cpp +++ b/src/x11/tray_manager.cpp @@ -1167,7 +1167,9 @@ bool tray_manager::on(const signals::ui::update_background&) { } bool tray_manager::on(const signals::ui_tray::tray_pos_change& evt) { - m_opts.orig_x = m_bar_opts.inner_area(true).x + evt.cast(); + m_opts.orig_x = + m_bar_opts.inner_area(true).x + std::max(0, std::min(evt.cast(), (int)(m_bar_opts.size.w - calculate_w()))); + reconfigure_window(); return true;