Created attachment 183157 [details] Showcase of the bug. SUMMARY When using fractional scaling, the saved screenshot will have a huge white space around the code. STEPS TO REPRODUCE 1. Open System Settings -> Display & Monitor -> Set scaling 125%. 2. Open a file in Kate. 3. Select a couple of lines. 4. Right click -> "Take Screenshot of Selection" -> Save. OBSERVED RESULT The image has a huge white space around it. EXPECTED RESULT The image should not show excessive white space around it. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Fedora 42 KDE Plasma Version: 6.4.2 KDE Frameworks Version: 6.15.0 Qt Version: 6.9.1 ADDITIONAL INFORMATION - It seems to have appeared with commit: https://invent.kde.org/frameworks/ktexteditor/-/commit/d5ef4a26cf5be5a0a0a22782db54e5627e8857d8
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/822
Git commit a8304647e3b76abf8be28308a01574e5caef4780 by Waqar Ahmed. Committed on 14/07/2025 at 19:27. Pushed by cullmann into branch 'master'. Properly center the screenshot pixmap Otherwise we have to do weird hacks because the pixmap occupies the full width. Use the m_screenshot->geometry() to get the grab rectangle. QWidget::geometry() returns the correct dpr divided geometry which is needed when calling QWidget::grab() as it scales the given rectangle's size by dpr again. M +7 -10 src/view/screenshotdialog.cpp https://invent.kde.org/frameworks/ktexteditor/-/commit/a8304647e3b76abf8be28308a01574e5caef4780