fix things in review

This commit is contained in:
codic 2021-12-18 23:23:51 -08:00
parent 9c654f471d
commit fed9b8ca04
3 changed files with 14 additions and 3 deletions

View file

@ -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() {

View file

@ -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);
}

View file

@ -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;
};