diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 812db85..d09b299 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -318,6 +318,7 @@ void parseLine(std::string& line) { } void ConfigManager::loadConfigLoadVars() { + const auto ORIGBORDERSIZE = ConfigManager::getInt("border_size"); Debug::log(LOG, "Reloading the config!"); ConfigManager::parseError = ""; // reset the error ConfigManager::currentCategory = ""; // reset the category @@ -402,6 +403,8 @@ void ConfigManager::loadConfigLoadVars() { loadBar = true; isFirstLaunch = false; + + if (ORIGBORDERSIZE != ConfigManager::getInt("border_size")) EWMH::refreshAllExtents(); } void ConfigManager::applyKeybindsToX() { diff --git a/src/ewmh/ewmh.cpp b/src/ewmh/ewmh.cpp index f2137b2..f9ae234 100644 --- a/src/ewmh/ewmh.cpp +++ b/src/ewmh/ewmh.cpp @@ -54,7 +54,14 @@ void EWMH::updateClientList() { 32, windowsList.size(), ArrWindowList); } -void EWMH::setFrameExtents(xcb_window_t w) { - uint32_t extents[4] = {ConfigManager::getInt("border_size"), ConfigManager::getInt("border_size"), ConfigManager::getInt("border_size"), ConfigManager::getInt("border_size")}; - xcb_change_property(g_pWindowManager->DisplayConnection, XCB_PROP_MODE_REPLACE, w, HYPRATOMS["_NET_FRAME_EXTENTS"], XCB_ATOM_CARDINAL, 32, 4, &extents); +void EWMH::refreshAllExtents() { + for (auto& w : g_pWindowManager->windows) + if (w.getDrawable() > 0) + setFrameExtents(w.getDrawable()); +} + +void EWMH::setFrameExtents(xcb_window_t w) { + const auto BORDERSIZE = ConfigManager::getInt("border_size"); + uint32_t extents[4] = {BORDERSIZE,BORDERSIZE,BORDERSIZE,BORDERSIZE}; + xcb_change_property(g_pWindowManager->DisplayConnection, XCB_PROP_MODE_REPLACE, w, HYPRATOMS["_NET_FRAME_EXTENTS"], XCB_ATOM_CARDINAL, 32, 4, &extents); } diff --git a/src/ewmh/ewmh.hpp b/src/ewmh/ewmh.hpp index c77da8d..cb26343 100644 --- a/src/ewmh/ewmh.hpp +++ b/src/ewmh/ewmh.hpp @@ -7,6 +7,7 @@ namespace EWMH { void updateCurrentWindow(xcb_window_t); void updateClientList(); void setFrameExtents(xcb_window_t); + void refreshAllExtents(); inline xcb_window_t EWMHwindow = XCB_WINDOW_NONE; };