diff options
author | Sungyoon Cho <[email protected]> | 2024-04-02 00:37:59 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2024-04-01 16:37:59 +0100 |
commit | db1506130b507f92e0daf3a36495fb985e242bbc (patch) | |
tree | 32ceee0cb8eb45ec40dd3e5775470c964c65c6df | |
parent | 108163f1e5e0e1423a170e78688a826963ec7a81 (diff) | |
download | Hyprland-db1506130b507f92e0daf3a36495fb985e242bbc.tar.gz Hyprland-db1506130b507f92e0daf3a36495fb985e242bbc.zip |
IME: Fix ime popup coordinates and artifacts (#5373)
* ime: fix incorrect popup coordinate
* ime: fix popup artifacts
-rw-r--r-- | src/managers/input/InputMethodPopup.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/managers/input/InputMethodPopup.cpp b/src/managers/input/InputMethodPopup.cpp index 326b982e..3332e9c3 100644 --- a/src/managers/input/InputMethodPopup.cpp +++ b/src/managers/input/InputMethodPopup.cpp @@ -77,10 +77,8 @@ void CInputPopup::damageEntire() { return; } - Vector2D pos = OWNER->getSurfaceBoxGlobal().value_or(CBox{0, 0, 0, 0}).pos(); - CBox global = lastBoxLocal.copy().translate(pos); - - g_pHyprRenderer->damageBox(&global); + Vector2D pos = OWNER->getSurfaceBoxGlobal().value_or(CBox{0, 0, 0, 0}).pos() + lastBoxLocal.pos(); + g_pHyprRenderer->damageBox(pos.x, pos.y, surface.wlr()->current.width, surface.wlr()->current.height); } void CInputPopup::damageSurface() { @@ -127,7 +125,9 @@ void CInputPopup::updateBox() { CMonitor* pMonitor = g_pCompositor->getMonitorFromVector(parentBox.middle()); if (cursorBoxLocal.y + parentBox.y + surface.wlr()->current.height + cursorBoxLocal.height > pMonitor->vecPosition.y + pMonitor->vecSize.y) - cursorBoxLocal.y -= surface.wlr()->current.height + cursorBoxLocal.height; + cursorBoxLocal.y -= surface.wlr()->current.height; + else + cursorBoxLocal.y += cursorBoxLocal.height; if (cursorBoxLocal.x + parentBox.x + surface.wlr()->current.width > pMonitor->vecPosition.x + pMonitor->vecSize.x) cursorBoxLocal.x -= (cursorBoxLocal.x + parentBox.x + surface.wlr()->current.width) - (pMonitor->vecPosition.x + pMonitor->vecSize.x); |