IME: Refactor and fixup popups

This commit is contained in:
Vaxry
2024-03-24 16:08:25 +00:00
parent acf15e5579
commit 5cc4bf699c
12 changed files with 260 additions and 198 deletions

View File

@@ -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<SIMEKbGrab> m_pKeyboardGrab;
std::unique_ptr<SIMEKbGrab> m_pKeyboardGrab;
std::list<std::unique_ptr<CTextInput>> m_vTextInputs;
std::list<SIMEPopup> m_lIMEPopups;
std::vector<std::unique_ptr<CTextInput>> m_vTextInputs;
std::vector<std::unique_ptr<CInputPopup>> 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;
};