From ea45c6bfe0388b7d49548538473ee80ab852cce7 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Tue, 16 Aug 2022 16:15:43 +0200 Subject: [PATCH] fix memory issue with hyprctl devices --- src/debug/HyprCtl.cpp | 2 +- src/managers/input/InputManager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index bee5ce79..7b36a6ce 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -386,7 +386,7 @@ R"#( { for (auto& k : g_pInputManager->m_lKeyboards) { const auto KM = g_pInputManager->getActiveLayoutForKeyboard(&k); - result += getFormat("\tKeyboard at %x:\n\t\t%s\n\t\t\trules: r \"%s\", m \"%s\", l \"%s\", v \"%s\", o \"%s\"\n\t\t\tactive keymap: %s\n", &k, k.keyboard->name, k.currentRules.rules.c_str(), k.currentRules.model.c_str(), k.currentRules.layout.c_str(), k.currentRules.variant.c_str(), k.currentRules.options.c_str(), KM); + result += getFormat("\tKeyboard at %x:\n\t\t%s\n\t\t\trules: r \"%s\", m \"%s\", l \"%s\", v \"%s\", o \"%s\"\n\t\t\tactive keymap: %s\n", &k, k.keyboard->name, k.currentRules.rules.c_str(), k.currentRules.model.c_str(), k.currentRules.layout.c_str(), k.currentRules.variant.c_str(), k.currentRules.options.c_str(), KM.c_str()); } result += "\n\nTablets:\n"; diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index c552910c..95b30587 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -894,7 +894,7 @@ std::string CInputManager::getActiveLayoutForKeyboard(SKeyboard* pKeyboard) { const auto STATE = WLRKB->xkb_state; const auto LAYOUTSNUM = xkb_keymap_num_layouts(KEYMAP); - for (auto i = 0; i < LAYOUTSNUM; ++i) { + for (uint32_t i = 0; i < LAYOUTSNUM; ++i) { if (xkb_state_layout_index_is_active(STATE, i, XKB_STATE_LAYOUT_EFFECTIVE)) { const auto LAYOUTNAME = xkb_keymap_layout_get_name(KEYMAP, i);