summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 58951281..976e292d 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -164,7 +164,7 @@ CKeybindManager::CKeybindManager() {
m_repeatKeyTimer = makeShared<CEventLoopTimer>(
std::nullopt,
[this](SP<CEventLoopTimer> self, void* data) {
- if (m_activeKeybinds.size() == 0 || g_pSeatManager->m_keyboard.expired())
+ if (m_activeKeybinds.empty() || g_pSeatManager->m_keyboard.expired())
return;
const auto PACTIVEKEEB = g_pSeatManager->m_keyboard.lock();
@@ -288,7 +288,7 @@ void CKeybindManager::updateXKBTranslationState() {
xkb_rule_names rules = {.rules = RULES.c_str(), .model = MODEL.c_str(), .layout = LAYOUT.c_str(), .variant = VARIANT.c_str(), .options = OPTIONS.c_str()};
const auto PCONTEXT = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
- FILE* const KEYMAPFILE = FILEPATH == "" ? nullptr : fopen(absolutePath(FILEPATH, g_pConfigManager->m_configCurrentPath).c_str(), "r");
+ FILE* const KEYMAPFILE = FILEPATH.empty() ? nullptr : fopen(absolutePath(FILEPATH, g_pConfigManager->m_configCurrentPath).c_str(), "r");
auto PKEYMAP = KEYMAPFILE ? xkb_keymap_new_from_file(PCONTEXT, KEYMAPFILE, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS) :
xkb_keymap_new_from_names(PCONTEXT, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS);
@@ -630,7 +630,7 @@ eMultiKeyCase CKeybindManager::mkKeysymSetMatches(const std::set<xkb_keysym_t> k
if (boundKeysNotPressed.empty() && pressedKeysNotBound.empty())
return MK_FULL_MATCH;
- if (boundKeysNotPressed.size() && pressedKeysNotBound.empty())
+ if (!boundKeysNotPressed.empty() && pressedKeysNotBound.empty())
return MK_PARTIAL_MATCH;
return MK_NO_MATCH;
@@ -2398,7 +2398,7 @@ SDispatchResult CKeybindManager::toggleSwallow(std::string args) {
}
SDispatchResult CKeybindManager::setSubmap(std::string submap) {
- if (submap == "reset" || submap == "") {
+ if (submap == "reset" || submap.empty()) {
m_currentSelectedSubmap = "";
Debug::log(LOG, "Reset active submap to the default one.");
g_pEventManager->postEvent(SHyprIPCEvent{"submap", ""});
@@ -2576,7 +2576,7 @@ SDispatchResult CKeybindManager::sendshortcut(std::string args) {
//if regexp is not empty, send shortcut to current window
//else, dont change focus
- if (regexp != "") {
+ if (!regexp.empty()) {
PWINDOW = g_pCompositor->getWindowByRegex(regexp);
if (!PWINDOW) {