From fc0a7af7ba5c52f7a70309020f5cb27c19d068e6 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 2 Apr 2024 16:10:55 +0100 Subject: [PATCH] IME: fix blurry ime on scaled ref #5387 --- src/managers/input/InputMethodPopup.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/managers/input/InputMethodPopup.cpp b/src/managers/input/InputMethodPopup.cpp index 36f25dd7..bc2876ad 100644 --- a/src/managers/input/InputMethodPopup.cpp +++ b/src/managers/input/InputMethodPopup.cpp @@ -57,6 +57,13 @@ void CInputPopup::onMap() { updateBox(); damageEntire(); + + const auto PMONITOR = g_pCompositor->getMonitorFromVector(globalBox().middle()); + + if (!PMONITOR) + return; + + g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(surface.wlr(), PMONITOR->scale); } void CInputPopup::onUnmap() { @@ -121,7 +128,7 @@ void CInputPopup::updateBox() { cursorBoxLocal = {0, 0, (int)parentBox.w, (int)parentBox.h}; } - Vector2D currentPopupSize = {surface.wlr()->current.width, surface.wlr()->current.height}; + Vector2D currentPopupSize = surface.getViewporterCorrectedSize(); if (cursorBoxLocal != lastBoxLocal || currentPopupSize != lastPopupSize) damageEntire();