diff options
Diffstat (limited to 'src/managers/PointerManager.cpp')
| -rw-r--r-- | src/managers/PointerManager.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/managers/PointerManager.cpp b/src/managers/PointerManager.cpp index 04deca9a..b6419e71 100644 --- a/src/managers/PointerManager.cpp +++ b/src/managers/PointerManager.cpp @@ -1,6 +1,7 @@ #include "PointerManager.hpp" #include "../Compositor.hpp" #include "../config/ConfigValue.hpp" +#include "../config/shared/actions/ConfigActions.hpp" #include "../config/legacy/ConfigManager.hpp" #include "../protocols/PointerGestures.hpp" #include "../protocols/RelativePointer.hpp" @@ -415,7 +416,7 @@ SP<Aquamarine::IBuffer> CPointerManager::renderHWCursorBuffer(SP<CPointerManager auto maxSize = state->monitor->m_output->cursorPlaneSize(); auto const& cursorSize = m_currentCursorImage.size; - static auto PCPUBUFFER = CConfigValue<Hyprlang::INT>("cursor:use_cpu_buffer"); + static auto PCPUBUFFER = CConfigValue<Config::INTEGER>("cursor:use_cpu_buffer"); const bool shouldUseCpuBuffer = *PCPUBUFFER == 1 || (*PCPUBUFFER != 0 && g_pHyprRenderer->isNvidia()); @@ -686,7 +687,7 @@ CBox CPointerManager::getCursorBoxGlobal() { } Vector2D CPointerManager::closestValid(const Vector2D& pos) { - static auto PADDING = CConfigValue<Hyprlang::INT>("cursor:hotspot_padding"); + static auto PADDING = CConfigValue<Config::INTEGER>("cursor:hotspot_padding"); auto CURSOR_PADDING = std::clamp(sc<int>(*PADDING), 0, 100); CBox hotBox = {{pos.x - CURSOR_PADDING, pos.y - CURSOR_PADDING}, {2 * CURSOR_PADDING, 2 * CURSOR_PADDING}}; @@ -926,7 +927,7 @@ void CPointerManager::attachPointer(SP<IPointer> pointer) { if (!pointer) return; - static auto PMOUSEDPMS = CConfigValue<Hyprlang::INT>("misc:mouse_move_enables_dpms"); + static auto PMOUSEDPMS = CConfigValue<Config::INTEGER>("misc:mouse_move_enables_dpms"); // auto listener = m_pointerListeners.emplace_back(makeShared<SPointerListener>()); @@ -939,8 +940,8 @@ void CPointerManager::attachPointer(SP<IPointer> pointer) { PROTO::idle->onActivity(); - if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) - CKeybindManager::dpms("on"); + if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) // NOLINTNEXTLINE + Config::Actions::dpms(Config::Actions::TOGGLE_ACTION_ENABLE, std::nullopt); }); listener->motionAbsolute = pointer->m_pointerEvents.motionAbsolute.listen([](const IPointer::SMotionAbsoluteEvent& event) { @@ -948,8 +949,8 @@ void CPointerManager::attachPointer(SP<IPointer> pointer) { PROTO::idle->onActivity(); - if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) - CKeybindManager::dpms("on"); + if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) // NOLINTNEXTLINE + Config::Actions::dpms(Config::Actions::TOGGLE_ACTION_ENABLE, std::nullopt); }); listener->button = pointer->m_pointerEvents.button.listen([weak = WP<IPointer>(pointer)](const IPointer::SButtonEvent& event) { @@ -968,8 +969,8 @@ void CPointerManager::attachPointer(SP<IPointer> pointer) { PROTO::idle->onActivity(); - if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) - CKeybindManager::dpms("on"); + if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) // NOLINTNEXTLINE + Config::Actions::dpms(Config::Actions::TOGGLE_ACTION_ENABLE, std::nullopt); }); listener->swipeEnd = pointer->m_pointerEvents.swipeEnd.listen([](const IPointer::SSwipeEndEvent& event) { @@ -987,8 +988,8 @@ void CPointerManager::attachPointer(SP<IPointer> pointer) { PROTO::idle->onActivity(); - if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) - CKeybindManager::dpms("on"); + if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) // NOLINTNEXTLINE + Config::Actions::dpms(Config::Actions::TOGGLE_ACTION_ENABLE, std::nullopt); }); listener->pinchEnd = pointer->m_pointerEvents.pinchEnd.listen([](const IPointer::SPinchEndEvent& event) { @@ -1020,7 +1021,7 @@ void CPointerManager::attachTouch(SP<ITouch> touch) { if (!touch) return; - static auto PMOUSEDPMS = CConfigValue<Hyprlang::INT>("misc:mouse_move_enables_dpms"); + static auto PMOUSEDPMS = CConfigValue<Config::INTEGER>("misc:mouse_move_enables_dpms"); // auto listener = m_touchListeners.emplace_back(makeShared<STouchListener>()); @@ -1034,8 +1035,8 @@ void CPointerManager::attachTouch(SP<ITouch> touch) { PROTO::idle->onActivity(); - if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) - CKeybindManager::dpms("on"); + if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) // NOLINTNEXTLINE + Config::Actions::dpms(Config::Actions::TOGGLE_ACTION_ENABLE, std::nullopt); }); listener->up = touch->m_touchEvents.up.listen([](const ITouch::SUpEvent& event) { @@ -1061,7 +1062,7 @@ void CPointerManager::attachTablet(SP<CTablet> tablet) { if (!tablet) return; - static auto PMOUSEDPMS = CConfigValue<Hyprlang::INT>("misc:mouse_move_enables_dpms"); + static auto PMOUSEDPMS = CConfigValue<Config::INTEGER>("misc:mouse_move_enables_dpms"); // auto listener = m_tabletListeners.emplace_back(makeShared<STabletListener>()); @@ -1075,8 +1076,8 @@ void CPointerManager::attachTablet(SP<CTablet> tablet) { PROTO::idle->onActivity(); - if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) - CKeybindManager::dpms("on"); + if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) // NOLINTNEXTLINE + Config::Actions::dpms(Config::Actions::TOGGLE_ACTION_ENABLE, std::nullopt); }); listener->proximity = tablet->m_tabletEvents.proximity.listen([](const CTablet::SProximityEvent& event) { @@ -1089,8 +1090,8 @@ void CPointerManager::attachTablet(SP<CTablet> tablet) { PROTO::idle->onActivity(); - if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) - CKeybindManager::dpms("on"); + if (!g_pCompositor->m_dpmsStateOn && *PMOUSEDPMS) // NOLINTNEXTLINE + Config::Actions::dpms(Config::Actions::TOGGLE_ACTION_ENABLE, std::nullopt); }); listener->button = tablet->m_tabletEvents.button.listen([](const CTablet::SButtonEvent& event) { |
