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

View File

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

View File

@ -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<SKeybind> m_dKeybinds;