tiv1: minor fixes for crashes

This commit is contained in:
vaxerski
2023-03-14 13:51:08 +00:00
parent 5dc1a5fec6
commit 0807b8b95f
3 changed files with 9 additions and 1 deletions

View File

@@ -113,6 +113,8 @@ void CTextInputV1ProtocolManager::removeTI(STextInputV1* pTI) {
// if ((*TI)->resourceImpl)
// wl_resource_destroy((*TI)->resourceImpl);
g_pInputManager->m_sIMERelay.removeTextInput((*TI)->pTextInput);
std::erase_if(m_pClients, [&](const auto& other) { return other.get() == pTI; });
}
@@ -131,6 +133,8 @@ static void destroyTI(wl_resource* resource) {
wl_resource_set_user_data(resource, nullptr);
}
g_pInputManager->m_sIMERelay.removeTextInput(TI->pTextInput);
TI->pTextInput->hyprListener_textInputDestroy.emit(nullptr);
g_pProtocolManager->m_pTextInputV1ProtocolManager->removeTI(TI);

View File

@@ -24,6 +24,8 @@ struct STextInputV1 {
uint32_t serial = 0;
bool active = false;
struct SPendingSurr {
bool isPending = false;
std::string text = "";