From 2e5435fe91d5e8273791737717a4c43675c51da9 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 19 Mar 2022 21:48:24 +0100 Subject: [PATCH] fix layout refresh on config and keybinds doubling --- src/config/ConfigManager.cpp | 4 ++++ src/managers/KeybindManager.cpp | 4 ++++ src/managers/KeybindManager.hpp | 1 + 3 files changed, 9 insertions(+) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 24195991..d53342b9 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -217,6 +217,7 @@ void CConfigManager::loadConfigLoadVars() { currentCategory = ""; // reset the category m_dMonitorRules.clear(); + g_pKeybindManager->clearKeybinds(); const char* const ENVHOME = getenv("HOME"); const std::string CONFIGPATH = ENVHOME + (ISDEBUG ? (std::string) "/.config/hypr/hyprlandd.conf" : (std::string) "/.config/hypr/hyprland.conf"); @@ -255,6 +256,9 @@ void CConfigManager::loadConfigLoadVars() { ifs.close(); } + + for (auto& m : g_pCompositor->m_lMonitors) + g_pLayoutManager->getCurrentLayout()->recalculateMonitor(m.ID); } void CConfigManager::tick() { diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index f61f6ac9..e1e77973 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -59,4 +59,8 @@ void CKeybindManager::spawn(std::string args) { void CKeybindManager::killActive(std::string args) { if (g_pCompositor->m_pLastFocus && g_pCompositor->windowValidMapped(g_pCompositor->m_pLastFocus)) g_pXWaylandManager->sendCloseWindow(g_pCompositor->m_pLastFocus); +} + +void CKeybindManager::clearKeybinds() { + m_dKeybinds.clear(); } \ No newline at end of file diff --git a/src/managers/KeybindManager.hpp b/src/managers/KeybindManager.hpp index 927b9b44..067a84bf 100644 --- a/src/managers/KeybindManager.hpp +++ b/src/managers/KeybindManager.hpp @@ -16,6 +16,7 @@ public: void handleKeybinds(const uint32_t&, const xkb_keysym_t&); void addKeybind(SKeybind); uint32_t stringToModMask(std::string); + void clearKeybinds(); private: std::deque m_dKeybinds;