diff options
author | vaxerski <[email protected]> | 2022-08-23 11:16:27 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-08-23 11:16:35 +0200 |
commit | 23c5760538c8db68c0b0d3b170c6e812f50a1bb4 (patch) | |
tree | 6147f1712ecc8a8a426c455e97edbd373010a525 | |
parent | 9bfa3ebc50f503f3eaa43dcad44a976e8ee14c73 (diff) | |
download | Hyprland-23c5760538c8db68c0b0d3b170c6e812f50a1bb4.tar.gz Hyprland-23c5760538c8db68c0b0d3b170c6e812f50a1bb4.zip |
IME Popup damage fixes
-rw-r--r-- | src/helpers/WLClasses.hpp | 1 | ||||
-rw-r--r-- | src/managers/input/InputMethodRelay.cpp | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 4c769202..57e01099 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -306,6 +306,7 @@ struct SIMEPopup { int x, y; int realX, realY; bool visible; + Vector2D lastSize; DYNLISTENER(mapPopup); DYNLISTENER(unmapPopup); diff --git a/src/managers/input/InputMethodRelay.cpp b/src/managers/input/InputMethodRelay.cpp index 4f18781a..e697c44f 100644 --- a/src/managers/input/InputMethodRelay.cpp +++ b/src/managers/input/InputMethodRelay.cpp @@ -125,6 +125,9 @@ void CInputMethodRelay::updateInputPopup(SIMEPopup* pPopup) { if (!pPopup->pSurface->mapped) return; + // damage last known pos & size + g_pHyprRenderer->damageBox(pPopup->realX, pPopup->realY, pPopup->lastSize.x, pPopup->lastSize.y); + const auto PFOCUSEDTI = getFocusedTextInput(); if (!PFOCUSEDTI || !PFOCUSEDTI->pWlrInput->focused_surface) @@ -167,6 +170,8 @@ void CInputMethodRelay::updateInputPopup(SIMEPopup* pPopup) { pPopup->realX = finalBox.x + parentPos.x; pPopup->realY = finalBox.y + parentPos.y + finalBox.height; + pPopup->lastSize = Vector2D(pPopup->pSurface->surface->current.width, pPopup->pSurface->surface->current.height); + wlr_input_popup_surface_v2_send_text_input_rectangle(pPopup->pSurface, &finalBox); damagePopup(pPopup); @@ -189,6 +194,8 @@ void Events::listener_unmapInputPopup(void* owner, void* data) { Debug::log(LOG, "Unmapped an IME Popup"); + g_pHyprRenderer->damageBox(PPOPUP->realX, PPOPUP->realY, PPOPUP->lastSize.x, PPOPUP->lastSize.y); + g_pInputManager->m_sIMERelay.updateInputPopup(PPOPUP); } |