https://bugs.kde.org/show_bug.cgi?id=517620

--- Comment #7 from Vlad Zahorodnii <[email protected]> ---
Git commit 8a7e6f6298bc05d689ddc490eac96260000091e7 by Vlad Zahorodnii.
Committed on 03/09/2026 at 07:45.
Pushed by vladz into branch 'Plasma/6.7'.

wayland: clamp surrounding-text offsets when clients set them

cursor and anchor are byte offsets into the surrounding text. They were
stored and forwarded exactly as the client supplied them, and input
methods trust them blindly: maliit-keyboard uses them as lengths and
pointer offsets and crashes when they do not fit the text - bug 517620
shows Discord/Electron triggering exactly that through text-input-v3.

Clamp the offsets when the client sets them, so the stored state is
consistent for every consumer.
Related: bug 516195


(cherry picked from commit 076befd796a930b3f165b09ae37769671af9ec1e)

Co-authored-by: Sebastian Müller <[email protected]>

M  +15   -0    autotests/wayland/server/CMakeLists.txt
A  +195  -0    autotests/wayland/server/test_textinputv2_interface.cpp    
[License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
M  +38   -0    autotests/wayland/server/test_textinputv3_interface.cpp
M  +6    -2    src/wayland/textinput_v2.cpp
M  +6    -2    src/wayland/textinput_v3.cpp

https://invent.kde.org/plasma/kwin/-/commit/8a7e6f6298bc05d689ddc490eac96260000091e7

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to