aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-08-23 11:16:27 +0200
committervaxerski <[email protected]>2022-08-23 11:16:35 +0200
commit23c5760538c8db68c0b0d3b170c6e812f50a1bb4 (patch)
tree6147f1712ecc8a8a426c455e97edbd373010a525
parent9bfa3ebc50f503f3eaa43dcad44a976e8ee14c73 (diff)
downloadHyprland-23c5760538c8db68c0b0d3b170c6e812f50a1bb4.tar.gz
Hyprland-23c5760538c8db68c0b0d3b170c6e812f50a1bb4.zip
IME Popup damage fixes
-rw-r--r--src/helpers/WLClasses.hpp1
-rw-r--r--src/managers/input/InputMethodRelay.cpp7
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);
}