diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2025-01-23 21:55:41 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-23 21:55:41 +0100 |
| commit | 0a1ae48a9fd6eb76baad27de98c00f653a55e4ac (patch) | |
| tree | 007cd36eb83d343d2aba49cf0741028c5f554895 /src/managers/input | |
| parent | ae403e6a05452336abd97e61be2706f6a930d827 (diff) | |
core: move all shared_ptrs from the STL to hyprutils (#9143)
Diffstat (limited to 'src/managers/input')
| -rw-r--r-- | src/managers/input/IdleInhibitor.cpp | 2 | ||||
| -rw-r--r-- | src/managers/input/InputManager.hpp | 4 | ||||
| -rw-r--r-- | src/managers/input/InputMethodRelay.cpp | 6 | ||||
| -rw-r--r-- | src/managers/input/InputMethodRelay.hpp | 6 | ||||
| -rw-r--r-- | src/managers/input/TextInput.hpp | 1 |
5 files changed, 9 insertions, 10 deletions
diff --git a/src/managers/input/IdleInhibitor.cpp b/src/managers/input/IdleInhibitor.cpp index 74760c0a..67837c17 100644 --- a/src/managers/input/IdleInhibitor.cpp +++ b/src/managers/input/IdleInhibitor.cpp @@ -5,7 +5,7 @@ #include "../../protocols/core/Compositor.hpp" void CInputManager::newIdleInhibitor(std::any inhibitor) { - const auto PINHIBIT = m_vIdleInhibitors.emplace_back(std::make_unique<SIdleInhibitor>()).get(); + const auto PINHIBIT = m_vIdleInhibitors.emplace_back(makeUnique<SIdleInhibitor>()).get(); PINHIBIT->inhibitor = std::any_cast<SP<CIdleInhibitor>>(inhibitor); Debug::log(LOG, "New idle inhibitor registered for surface {:x}", (uintptr_t)PINHIBIT->inhibitor->surface.get()); diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp index 36c8144d..c0f1939e 100644 --- a/src/managers/input/InputManager.hpp +++ b/src/managers/input/InputManager.hpp @@ -268,7 +268,7 @@ class CInputManager { bool nonDesktop = false; CHyprSignalListener surfaceDestroyListener; }; - std::vector<std::unique_ptr<SIdleInhibitor>> m_vIdleInhibitors; + std::vector<UP<SIdleInhibitor>> m_vIdleInhibitors; // swipe void beginWorkspaceSwipe(); @@ -304,4 +304,4 @@ class CInputManager { friend class CWLSurface; }; -inline std::unique_ptr<CInputManager> g_pInputManager; +inline UP<CInputManager> g_pInputManager; diff --git a/src/managers/input/InputMethodRelay.cpp b/src/managers/input/InputMethodRelay.cpp index 58cff043..5f6c4354 100644 --- a/src/managers/input/InputMethodRelay.cpp +++ b/src/managers/input/InputMethodRelay.cpp @@ -50,7 +50,7 @@ void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) { }); listeners.newPopup = pIME->events.newPopup.registerListener([this](std::any d) { - m_vIMEPopups.emplace_back(std::make_unique<CInputPopup>(std::any_cast<SP<CInputMethodPopupV2>>(d))); + m_vIMEPopups.emplace_back(makeUnique<CInputPopup>(std::any_cast<SP<CInputMethodPopupV2>>(d))); Debug::log(LOG, "New input popup"); }); @@ -86,11 +86,11 @@ CTextInput* CInputMethodRelay::getFocusedTextInput() { } void CInputMethodRelay::onNewTextInput(WP<CTextInputV3> tiv3) { - m_vTextInputs.emplace_back(std::make_unique<CTextInput>(tiv3)); + m_vTextInputs.emplace_back(makeUnique<CTextInput>(tiv3)); } void CInputMethodRelay::onNewTextInput(WP<CTextInputV1> pTIV1) { - m_vTextInputs.emplace_back(std::make_unique<CTextInput>(pTIV1)); + m_vTextInputs.emplace_back(makeUnique<CTextInput>(pTIV1)); } void CInputMethodRelay::removeTextInput(CTextInput* pInput) { diff --git a/src/managers/input/InputMethodRelay.hpp b/src/managers/input/InputMethodRelay.hpp index 998e1fc6..602a939a 100644 --- a/src/managers/input/InputMethodRelay.hpp +++ b/src/managers/input/InputMethodRelay.hpp @@ -40,10 +40,10 @@ class CInputMethodRelay { WP<CInputMethodV2> m_pIME; private: - std::vector<std::unique_ptr<CTextInput>> m_vTextInputs; - std::vector<std::unique_ptr<CInputPopup>> m_vIMEPopups; + std::vector<UP<CTextInput>> m_vTextInputs; + std::vector<UP<CInputPopup>> m_vIMEPopups; - WP<CWLSurfaceResource> m_pLastKbFocus; + WP<CWLSurfaceResource> m_pLastKbFocus; struct { CHyprSignalListener newTIV3; diff --git a/src/managers/input/TextInput.hpp b/src/managers/input/TextInput.hpp index c0b590ac..37b471af 100644 --- a/src/managers/input/TextInput.hpp +++ b/src/managers/input/TextInput.hpp @@ -3,7 +3,6 @@ #include "../../helpers/math/Math.hpp" #include "../../helpers/signal/Signal.hpp" #include "../../helpers/memory/Memory.hpp" -#include <memory> struct wl_client; |
