summaryrefslogtreecommitdiff
path: root/src/managers/input/InputMethodRelay.hpp
diff options
context:
space:
mode:
authorjoshua <54235339+sujoshua@users.noreply.github.com>2024-03-19 23:54:33 +0800
committerGitHub <noreply@github.com>2024-03-19 15:54:33 +0000
commit5c1097cbc19131a7770b2a3f01f6f24e626991d2 (patch)
treee9d27ddf894b088dd26f66dcd7280fdce46730e6 /src/managers/input/InputMethodRelay.hpp
parent05c84304ccb1169b550504830139e07e28500a3b (diff)
IME: Improve handling of text-input and ime-relay (#5147)
* input: Handling multiple surfaces for the text-input-v1 protocol implementation and imporve InputMethodRelay logic fixes #2708 * clang-format * minor style nits --------- Co-authored-by: Vaxry <vaxry@vaxry.net>
Diffstat (limited to 'src/managers/input/InputMethodRelay.hpp')
-rw-r--r--src/managers/input/InputMethodRelay.hpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/managers/input/InputMethodRelay.hpp b/src/managers/input/InputMethodRelay.hpp
index 9f9e95f6..39465cab 100644
--- a/src/managers/input/InputMethodRelay.hpp
+++ b/src/managers/input/InputMethodRelay.hpp
@@ -22,9 +22,6 @@ class CInputMethodRelay {
void onKeyboardFocus(wlr_surface*);
STextInput* getFocusedTextInput();
- STextInput* getFocusableTextInput();
-
- void setPendingSurface(STextInput*, wlr_surface*);
SIMEKbGrab* getIMEKeyboardGrab(SKeyboard*);
@@ -45,8 +42,22 @@ class CInputMethodRelay {
DYNLISTENER(IMEGrab);
DYNLISTENER(IMENewPopup);
- void createNewTextInput(wlr_text_input_v3*, STextInputV1* tiv1 = nullptr);
- wlr_surface* focusedSurface(STextInput* pInput);
+ 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;