IME: don't assert on lock mismatch, just fix it

This commit is contained in:
Vaxry 2024-03-30 17:00:56 +00:00
parent 906e498144
commit 77f26997fd

View file

@ -170,7 +170,11 @@ void CTextInput::enter(wlr_surface* pSurface) {
} }
enterLocks++; enterLocks++;
RASSERT(enterLocks == 1, "TextInput had != 1 lock in enter"); if (enterLocks != 1) {
Debug::log(ERR, "BUG THIS: TextInput has != 1 locks in enter");
leave();
enterLocks = 1;
}
if (pWlrInput) if (pWlrInput)
wlr_text_input_v3_send_enter(pWlrInput, pSurface); wlr_text_input_v3_send_enter(pWlrInput, pSurface);
@ -187,7 +191,10 @@ void CTextInput::leave() {
return; return;
enterLocks--; enterLocks--;
RASSERT(enterLocks == 0, "TextInput had != 0 locks in leave"); if (enterLocks != 1) {
Debug::log(ERR, "BUG THIS: TextInput has != 0 locks in leave");
enterLocks = 0;
}
if (pWlrInput && pWlrInput->focused_surface) if (pWlrInput && pWlrInput->focused_surface)
wlr_text_input_v3_send_leave(pWlrInput); wlr_text_input_v3_send_leave(pWlrInput);