diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-03-22 23:08:52 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-03-22 23:08:52 +0000 |
| commit | 9f2ed02f35232f0362db45d5f580025f5724500a (patch) | |
| tree | 5ae8bc60816353d04ca25c8a58affe63d09efc53 /src/managers/input/InputMethodRelay.hpp | |
| parent | 8c88689faf691a4369528e6d3d52c024cd61125d (diff) | |
IME/TI: Fixes and refactoring
Fixes #5189
Diffstat (limited to 'src/managers/input/InputMethodRelay.hpp')
| -rw-r--r-- | src/managers/input/InputMethodRelay.hpp | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/src/managers/input/InputMethodRelay.hpp b/src/managers/input/InputMethodRelay.hpp index 6f99cae2..7618400f 100644 --- a/src/managers/input/InputMethodRelay.hpp +++ b/src/managers/input/InputMethodRelay.hpp @@ -3,6 +3,7 @@ #include <list> #include "../../defines.hpp" #include "../../helpers/WLClasses.hpp" +#include "TextInput.hpp" class CInputManager; struct STextInputV1; @@ -13,15 +14,16 @@ class CInputMethodRelay { void onNewIME(wlr_input_method_v2*); void onNewTextInput(wlr_text_input_v3*); + void onNewTextInput(STextInputV1* pTIV1); wlr_input_method_v2* m_pWLRIME = nullptr; - void commitIMEState(STextInput* pInput); - void removeTextInput(STextInput* pInput); + void commitIMEState(CTextInput* pInput); + void removeTextInput(CTextInput* pInput); void onKeyboardFocus(wlr_surface*); - STextInput* getFocusedTextInput(); + CTextInput* getFocusedTextInput(); SIMEKbGrab* getIMEKeyboardGrab(SKeyboard*); @@ -31,10 +33,12 @@ class CInputMethodRelay { void removePopup(SIMEPopup*); private: - std::unique_ptr<SIMEKbGrab> m_pKeyboardGrab; + std::unique_ptr<SIMEKbGrab> m_pKeyboardGrab; - std::list<STextInput> m_lTextInputs; - std::list<SIMEPopup> m_lIMEPopups; + std::list<std::unique_ptr<CTextInput>> m_vTextInputs; + std::list<SIMEPopup> m_lIMEPopups; + + wlr_surface* m_pLastKbFocus = nullptr; DYNLISTENER(textInputNew); DYNLISTENER(IMECommit); @@ -42,25 +46,8 @@ class CInputMethodRelay { DYNLISTENER(IMEGrab); DYNLISTENER(IMENewPopup); - void createNewTextInput(wlr_text_input_v3*, STextInputV1* tiv1 = nullptr); - - wlr_surface* focusedSurface(STextInput* pInput); - wlr_surface* m_pFocusedSurface; - void onTextInputLeave(wlr_surface* pSurface); - void onTextInputEnter(wlr_surface* pSurface); - - std::unordered_map<wlr_surface*, STextInput*> m_mSurfaceToTextInput; - void setSurfaceToPTI(wlr_surface* pSurface, STextInput* pInput); - STextInput* getTextInput(wlr_surface* pSurface); - void removeSurfaceToPTI(STextInput* pInput); - - std::unordered_map<wl_client*, int> m_mClientTextInputVersion; - int setTextInputVersion(wl_client* pClient, int version); - int getTextInputVersion(wl_client* pClient); - void removeTextInputVersion(wl_client* pClient); - friend class CHyprRenderer; friend class CInputManager; friend class CTextInputV1ProtocolManager; - friend struct STextInput; + friend struct CTextInput; }; |
