summaryrefslogtreecommitdiff
path: root/src/protocols/TextInputV1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocols/TextInputV1.cpp')
-rw-r--r--src/protocols/TextInputV1.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/protocols/TextInputV1.cpp b/src/protocols/TextInputV1.cpp
index 7c16ef8c..12068671 100644
--- a/src/protocols/TextInputV1.cpp
+++ b/src/protocols/TextInputV1.cpp
@@ -10,13 +10,20 @@ static void bindManagerInt(wl_client* client, void* data, uint32_t version, uint
}
static void handleDisplayDestroy(struct wl_listener* listener, void* data) {
- g_pProtocolManager->m_pTextInputV1ProtocolManager->displayDestroy();
+ CTextInputV1ProtocolManager* proto = wl_container_of(listener, proto, m_liDisplayDestroy);
+ proto->displayDestroy();
}
void CTextInputV1ProtocolManager::displayDestroy() {
+ wl_list_remove(&m_liDisplayDestroy.link);
+ wl_list_init(&m_liDisplayDestroy.link);
wl_global_destroy(m_pGlobal);
}
+CTextInputV1ProtocolManager::~CTextInputV1ProtocolManager() {
+ displayDestroy();
+}
+
CTextInputV1ProtocolManager::CTextInputV1ProtocolManager() {
m_pGlobal = wl_global_create(g_pCompositor->m_sWLDisplay, &zwp_text_input_manager_v1_interface, TEXT_INPUT_VERSION, this, bindManagerInt);
@@ -220,4 +227,4 @@ void CTextInputV1ProtocolManager::handleCommitState(wl_client* client, wl_resour
void CTextInputV1ProtocolManager::handleInvokeAction(wl_client* client, wl_resource* resource, uint32_t button, uint32_t index) {
;
-} \ No newline at end of file
+}