From a3f2e8aa51aadce033e67248fa8ecf5645e74345 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Sat, 3 Dec 2016 18:38:33 +0100 Subject: [PATCH] fix: Reconfigure position after mapping Ref #212 --- include/components/bar.hpp | 4 +++- src/components/bar.cpp | 31 +++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/include/components/bar.hpp b/include/components/bar.hpp index fb6170a1..87b64ef7 100644 --- a/include/components/bar.hpp +++ b/include/components/bar.hpp @@ -36,7 +36,9 @@ class bar : public xpp::event::sinkroot()); auto w = m_opts.size.w + m_opts.offset.x; auto h = m_opts.size.h + m_opts.offset.y; - auto x = m_opts.pos.x; - auto y = m_opts.pos.y; if (m_opts.origin == edge::BOTTOM) { h += m_opts.strut.top; @@ -552,9 +563,13 @@ void bar::reconfigure_window() { } window win{m_connection, m_window}; - win.reconfigure_struts(w, h, x, m_opts.origin == edge::BOTTOM); - win.reconfigure_pos(x, y); + win.reconfigure_struts(w, h, m_opts.pos.x, m_opts.origin == edge::BOTTOM); +} +/** + * Reconfigure window wm hint values + */ +void bar::reconfigure_wm_hints() { m_log.trace("bar: Set window WM_NAME"); xcb_icccm_set_wm_name(m_connection, m_window, XCB_ATOM_STRING, 8, m_opts.wmname.size(), m_opts.wmname.c_str()); xcb_icccm_set_wm_class(m_connection, m_window, 15, "polybar\0Polybar");