From 969b642e0b8ea7df3de33f3b0efb74195d5e5f93 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Thu, 19 Jun 2025 22:20:36 -0400 Subject: [PATCH] refactor: EiScreen sonar adjustments --- src/lib/platform/EiScreen.cpp | 9 +++++---- src/lib/platform/EiScreen.h | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib/platform/EiScreen.cpp b/src/lib/platform/EiScreen.cpp index 1692fe384..fd04a66ae 100644 --- a/src/lib/platform/EiScreen.cpp +++ b/src/lib/platform/EiScreen.cpp @@ -197,7 +197,7 @@ std::uint32_t EiScreen::registerHotKey(KeyID key, KeyModifierMask mask) auto set = m_hotkeys.find(key); if (set == m_hotkeys.end()) { - m_hotkeys.emplace(key, HotKeySet{key}); + m_hotkeys.try_emplace(key, HotKeySet{key}); set = m_hotkeys.find(key); } set->second.addItem(HotKeyItem(mask, id)); @@ -207,8 +207,9 @@ std::uint32_t EiScreen::registerHotKey(KeyID key, KeyModifierMask mask) void EiScreen::unregisterHotKey(uint32_t id) { - for (auto &set : m_hotkeys) { - if (set.second.removeById(id)) { + for (auto &[key, set] : m_hotkeys) { + (void)key; + if (set.removeById(id)) { break; } } @@ -689,7 +690,7 @@ void EiScreen::onMotionEvent(ei_event *event) } } -void EiScreen::onAbsMotionEvent(const ei_event *event) const +void EiScreen::onAbsMotionEvent(const ei_event *) const { assert(m_isPrimary); } diff --git a/src/lib/platform/EiScreen.h b/src/lib/platform/EiScreen.h index 817bd1583..58ea41608 100644 --- a/src/lib/platform/EiScreen.h +++ b/src/lib/platform/EiScreen.h @@ -11,6 +11,7 @@ #include "deskflow/PlatformScreen.h" #include +#include #include #include #include @@ -96,14 +97,14 @@ private: void onPointerScrollEvent(ei_event *event); void onPointerScrollDiscreteEvent(ei_event *event); void onMotionEvent(ei_event *event); - void onAbsMotionEvent(const ei_event *event) const; + void onAbsMotionEvent(const ei_event *) const; bool onHotkey(KeyID key, bool is_press, KeyModifierMask mask); void eiLogEvent(ei_log_priority priority, const char *message) const; void handleConnectedToEisEvent(const Event &event); void handlePortalSessionClosed(); - static void handleEiLogEvent(ei *ei, ei_log_priority priority, const char *message, ei_log_context *context) + static void handleEiLogEvent(ei *ei, const ei_log_priority priority, const char *message, ei_log_context *) { auto screen = static_cast(ei_get_user_data(ei)); screen->eiLogEvent(priority, message);