From 8bcccf9f0f0f69986e315d4288dfdbf119dd19db Mon Sep 17 00:00:00 2001 From: Vaxry Date: Wed, 1 May 2024 16:41:17 +0100 Subject: ime-v2: move to new impl --- src/managers/input/InputMethodPopup.hpp | 43 ++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'src/managers/input/InputMethodPopup.hpp') diff --git a/src/managers/input/InputMethodPopup.hpp b/src/managers/input/InputMethodPopup.hpp index aed4dbc2..61b45d74 100644 --- a/src/managers/input/InputMethodPopup.hpp +++ b/src/managers/input/InputMethodPopup.hpp @@ -4,17 +4,13 @@ #include "../../desktop/WLSurface.hpp" #include "../../macros.hpp" #include "../../helpers/Box.hpp" +#include "../../helpers/signal/Listener.hpp" -struct wlr_input_popup_surface_v2; +class CInputMethodPopupV2; class CInputPopup { public: - CInputPopup(wlr_input_popup_surface_v2* surf); - - void onDestroy(); - void onMap(); - void onUnmap(); - void onCommit(); + CInputPopup(SP popup); void damageEntire(); void damageSurface(); @@ -24,18 +20,25 @@ class CInputPopup { CBox globalBox(); wlr_surface* getWlrSurface(); + void onCommit(); + 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); + CWLSurface* queryOwner(); + void updateBox(); + + void onDestroy(); + void onMap(); + void onUnmap(); + + WP popup; + CWLSurface surface; + CBox lastBoxLocal; + uint64_t lastMonitor = -1; + + struct { + CHyprSignalListener map; + CHyprSignalListener unmap; + CHyprSignalListener destroy; + CHyprSignalListener commit; + } listeners; }; -- cgit v1.2.3