fix layout refresh on config and keybinds doubling

This commit is contained in:
vaxerski 2022-03-19 21:48:24 +01:00
parent 7b7ce638f4
commit 2e5435fe91
3 changed files with 9 additions and 0 deletions

View file

@ -217,6 +217,7 @@ void CConfigManager::loadConfigLoadVars() {
currentCategory = ""; // reset the category currentCategory = ""; // reset the category
m_dMonitorRules.clear(); m_dMonitorRules.clear();
g_pKeybindManager->clearKeybinds();
const char* const ENVHOME = getenv("HOME"); const char* const ENVHOME = getenv("HOME");
const std::string CONFIGPATH = ENVHOME + (ISDEBUG ? (std::string) "/.config/hypr/hyprlandd.conf" : (std::string) "/.config/hypr/hyprland.conf"); 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(); ifs.close();
} }
for (auto& m : g_pCompositor->m_lMonitors)
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(m.ID);
} }
void CConfigManager::tick() { void CConfigManager::tick() {

View file

@ -59,4 +59,8 @@ void CKeybindManager::spawn(std::string args) {
void CKeybindManager::killActive(std::string args) { void CKeybindManager::killActive(std::string args) {
if (g_pCompositor->m_pLastFocus && g_pCompositor->windowValidMapped(g_pCompositor->m_pLastFocus)) if (g_pCompositor->m_pLastFocus && g_pCompositor->windowValidMapped(g_pCompositor->m_pLastFocus))
g_pXWaylandManager->sendCloseWindow(g_pCompositor->m_pLastFocus); g_pXWaylandManager->sendCloseWindow(g_pCompositor->m_pLastFocus);
}
void CKeybindManager::clearKeybinds() {
m_dKeybinds.clear();
} }

View file

@ -16,6 +16,7 @@ public:
void handleKeybinds(const uint32_t&, const xkb_keysym_t&); void handleKeybinds(const uint32_t&, const xkb_keysym_t&);
void addKeybind(SKeybind); void addKeybind(SKeybind);
uint32_t stringToModMask(std::string); uint32_t stringToModMask(std::string);
void clearKeybinds();
private: private:
std::deque<SKeybind> m_dKeybinds; std::deque<SKeybind> m_dKeybinds;