diff --git a/include/components/bar.hpp b/include/components/bar.hpp index 17516d7e..dc986c45 100644 --- a/include/components/bar.hpp +++ b/include/components/bar.hpp @@ -36,7 +36,7 @@ class bar : public xpp::event::sinkroot); + m_screensize.w = geom->width; + m_screensize.h = geom->height; + // limit the amount of allowed input events to 1 per 60ms m_throttler = throttle_util::make_throttler(1, 60ms); @@ -671,6 +675,7 @@ void bar::restack_window() { * Map window and reconfigure its position */ void bar::map_window() { + auto geom = m_connection.get_geometry(m_screen->root); auto w = m_opts.width + m_opts.offset_x; auto h = m_opts.height + m_opts.offset_y; auto x = m_opts.x; @@ -682,6 +687,10 @@ void bar::map_window() { h += m_opts.margins.b; } + if (m_opts.bottom && m_opts.monitor->y + m_opts.monitor->h < m_screensize.h) { + h += m_screensize.h - (m_opts.monitor->y + m_opts.monitor->h); + } + m_window.map_checked(); m_window.reconfigure_struts(w, h, x, m_opts.bottom); m_window.reconfigure_pos(x, y);