text-input: reset lock counter on surface destroy

fixes #5231
This commit is contained in:
Vaxry 2024-03-24 15:00:00 +00:00
parent 86dc46ffea
commit acf15e5579

View file

@ -127,6 +127,8 @@ void CTextInput::setFocusedSurface(wlr_surface* pSurface) {
[this](void* owner, void* data) { [this](void* owner, void* data) {
Debug::log(LOG, "Unmap TI owner1"); Debug::log(LOG, "Unmap TI owner1");
if (enterLocks)
enterLocks--;
pFocusedSurface = nullptr; pFocusedSurface = nullptr;
hyprListener_surfaceUnmapped.removeCallback(); hyprListener_surfaceUnmapped.removeCallback();
hyprListener_surfaceDestroyed.removeCallback(); hyprListener_surfaceDestroyed.removeCallback();
@ -138,6 +140,8 @@ void CTextInput::setFocusedSurface(wlr_surface* pSurface) {
[this](void* owner, void* data) { [this](void* owner, void* data) {
Debug::log(LOG, "destroy TI owner1"); Debug::log(LOG, "destroy TI owner1");
if (enterLocks)
enterLocks--;
pFocusedSurface = nullptr; pFocusedSurface = nullptr;
hyprListener_surfaceUnmapped.removeCallback(); hyprListener_surfaceUnmapped.removeCallback();
hyprListener_surfaceDestroyed.removeCallback(); hyprListener_surfaceDestroyed.removeCallback();