Bug 476979

Summary: Display of dragged text wrong when word-wrap is enabled
Product: [Frameworks and Libraries] frameworks-ktexteditor Reporter: Grósz Dániel <groszdanielpub>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: rodrigo.pedra
Priority: NOR    
Version First Reported In: 5.110.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screen recording

Description Grósz Dániel 2023-11-14 08:44:20 UTC
Created attachment 163141 [details]
Screen recording

SUMMARY
In KTextEditor-based editors (tried Kate, KWrite, KDevelop) when dragging selected text, the dragged text is shown near the mouse cursor. However, if word-wrap is enabled and there are some wrapped lines above the selection, the location of the dragged text is wrong. If the selected text is across multiple lines involving automatically wrapped lines, the content of the displayed text is wrong as well.

It's best explained with a screen recording.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20231001
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.5.4-1-default (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
Bug 468196 was a similar issue.
Comment 1 Bug Janitor Service 2024-07-31 17:52:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/709
Comment 2 Christoph Cullmann 2024-08-01 20:17:16 UTC
Git commit db25cdc5541e01429177cdd0c3b787658b276b3b by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 01/08/2024 at 20:12.
Pushed by cullmann into branch 'master'.

Fix drag pixmap with wrapped lines

M  +3    -3    src/render/katerenderer.cpp
M  +1    -1    src/render/katerenderer.h
M  +8    -4    src/view/kateviewinternal.cpp

https://invent.kde.org/frameworks/ktexteditor/-/commit/db25cdc5541e01429177cdd0c3b787658b276b3b