From 5cc4bf699cfe4d5915b8ea9f2a7c8449cdc7bd2f Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 24 Mar 2024 16:08:25 +0000 Subject: IME: Refactor and fixup popups --- src/managers/input/InputMethodRelay.hpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/managers/input/InputMethodRelay.hpp') diff --git a/src/managers/input/InputMethodRelay.hpp b/src/managers/input/InputMethodRelay.hpp index 7618400f..f19b4bb5 100644 --- a/src/managers/input/InputMethodRelay.hpp +++ b/src/managers/input/InputMethodRelay.hpp @@ -4,8 +4,10 @@ #include "../../defines.hpp" #include "../../helpers/WLClasses.hpp" #include "TextInput.hpp" +#include "InputMethodPopup.hpp" class CInputManager; +class CHyprRenderer; struct STextInputV1; class CInputMethodRelay { @@ -27,18 +29,20 @@ class CInputMethodRelay { SIMEKbGrab* getIMEKeyboardGrab(SKeyboard*); - void setIMEPopupFocus(SIMEPopup*, wlr_surface*); - void updateInputPopup(SIMEPopup*); - void damagePopup(SIMEPopup*); - void removePopup(SIMEPopup*); + void setIMEPopupFocus(CInputPopup*, wlr_surface*); + void removePopup(CInputPopup*); + + CInputPopup* popupFromCoords(const Vector2D& point); + + void updateAllPopups(); private: - std::unique_ptr m_pKeyboardGrab; + std::unique_ptr m_pKeyboardGrab; - std::list> m_vTextInputs; - std::list m_lIMEPopups; + std::vector> m_vTextInputs; + std::vector> m_vIMEPopups; - wlr_surface* m_pLastKbFocus = nullptr; + wlr_surface* m_pLastKbFocus = nullptr; DYNLISTENER(textInputNew); DYNLISTENER(IMECommit); @@ -50,4 +54,5 @@ class CInputMethodRelay { friend class CInputManager; friend class CTextInputV1ProtocolManager; friend struct CTextInput; + friend class CHyprRenderer; }; -- cgit v1.2.3