diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-03-24 16:08:25 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-03-24 16:08:25 +0000 |
| commit | 5cc4bf699cfe4d5915b8ea9f2a7c8449cdc7bd2f (patch) | |
| tree | d524435ee7bafe19d1bfdb2d741bc0e2c7ae30ee /src/managers/input/InputMethodPopup.hpp | |
| parent | acf15e5579a5d2bbbe4a13e87306445e31ea5e4f (diff) | |
IME: Refactor and fixup popups
Diffstat (limited to 'src/managers/input/InputMethodPopup.hpp')
| -rw-r--r-- | src/managers/input/InputMethodPopup.hpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/managers/input/InputMethodPopup.hpp b/src/managers/input/InputMethodPopup.hpp new file mode 100644 index 00000000..8bcf1101 --- /dev/null +++ b/src/managers/input/InputMethodPopup.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include "../../helpers/WLListener.hpp" +#include "../../desktop/WLSurface.hpp" +#include "../../macros.hpp" +#include "../../helpers/Box.hpp" + +struct wlr_input_popup_surface_v2; + +class CInputPopup { + public: + CInputPopup(wlr_input_popup_surface_v2* surf); + + void onDestroy(); + void onMap(); + void onUnmap(); + void onCommit(); + + void damageEntire(); + void damageSurface(); + + bool isVecInPopup(const Vector2D& point); + + CBox globalBox(); + wlr_surface* getWlrSurface(); + + private: + void initCallbacks(); + CWLSurface* queryOwner(); + void updateBox(); + + wlr_input_popup_surface_v2* pWlr = nullptr; + CWLSurface surface; + CBox lastBoxLocal; + uint64_t lastMonitor = -1; + + DYNLISTENER(mapPopup); + DYNLISTENER(unmapPopup); + DYNLISTENER(destroyPopup); + DYNLISTENER(commitPopup); +};
\ No newline at end of file |
