Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.2, 6.8.3
-
None
-
KDE & Wayfire on Arch Linux
Description
To reproduce:
- focus an input field and activate input method, maybe type something
- right click to bring up a popup menu
- dismiss the popup
- continue to type
- the input method window appears at the topleft corner for some time
This happens because when the popup is closed, the text input is entered and
enabled, but Qt doesn't call set_cursor_rectangle as it thinks there is no need
to update the position. However, the position is invalidated by the disable
request when focus switches to the popup.
This happens with Wayfire (misplaced briefly) and KDE (misplaced for longer; QT_WAYLAND_TEXT_INPUT_PROTOCOL=zwp_text_input_v3 needs to be set).
This doesn't happen for GNOME, Sway & niri because they don't hide input method window when the popup is shown.
The following patch fixes this:
diff --git a/src/client/qwaylandtextinputv3.cpp b/src/client/qwaylandtextinputv3.cpp
index 792d360e..3dcc9c46 100644
--- a/src/client/qwaylandtextinputv3.cpp
+++ b/src/client/qwaylandtextinputv3.cpp
@@ -283,7 +283,7 @@ void QWaylandTextInputv3::updateState(Qt::InputMethodQueries queries, uint32_t f
const QRect &nativeRect = QHighDpi::toNativePixels(windowRect, QGuiApplication::focusWindow());
const QMargins margins = window->clientSideMargins();
const QRect &surfaceRect = nativeRect.translated(margins.left(), margins.top());
- if (surfaceRect != m_cursorRect) {
+ if (surfaceRect != m_cursorRect || flags == update_state_enter) {
set_cursor_rectangle(surfaceRect.x(), surfaceRect.y(), surfaceRect.width(), surfaceRect.height());
m_cursorRect = surfaceRect;
needsCommit = true;