Bug 483338 - KDE Wayland line under window decorations at 120% fractional scale
Summary: KDE Wayland line under window decorations at 120% fractional scale
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: decorations (show other bugs)
Version: 6.2.3
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Nick
URL:
Keywords:
: 486469 488357 489905 493458 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-03-12 12:53 UTC by Aariz
Modified: 2024-12-13 15:39 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
You can see a purple line right under the titlebar window decoration that is bleeding from the background. (145.85 KB, image/png)
2024-03-12 12:53 UTC, Aariz
Details
Confirmed (120.25 KB, image/png)
2024-03-19 08:03 UTC, Nick
Details
Glitch between window title and content (21.76 KB, image/png)
2024-05-12 08:28 UTC, Liz Lee
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aariz 2024-03-12 12:53:07 UTC
Created attachment 167028 [details]
You can see a purple line right under the titlebar window decoration that is bleeding from the background.

There is an obvious line when a qt6 program is maximized on Wayland session with fractional scaling set at 120%

STEPS TO REPRODUCE
1. Use KDE Wayland Session
2. Use fractkonal scaling at 120%
3. Maximize a qt6 app window

OBSERVED RESULT

Line from background window decoration bleeding through 


EXPECTED RESULT

No line under window decoration from background bleeding

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Nick 2024-03-19 08:03:31 UTC
Created attachment 167457 [details]
Confirmed

Hi - I can duplicate this using the OP's description. Here you can see in the top left of the Dolphin window, under the title bar, some of Neon's default wallpaper bleeding through in a thin horizontal line. Dolphin must be full-screen to duplicate this. Display scaling set to 120%.

I'm on the latest Neon, Wayland, and intel graphics.

Marking as a  confirmed bug for further investigation.
Comment 2 Nate Graham 2024-03-19 19:07:45 UTC
More fractional pixel rounding issues, I expect. Xaver, should we mark this as a duplicate of something existing, or track it separately?
Comment 3 Zamundaaa 2024-04-13 12:14:42 UTC
*** Bug 485472 has been marked as a duplicate of this bug. ***
Comment 4 Liz Lee 2024-05-12 08:25:39 UTC
I can confirm it too.
Scaling is set to 150% in my case.

Fedora 40, Kernel 6.8.9.300.fc40.x86_64, wayland
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0

GRAPHICS INFO
Hardware: AMD Ryzen 6600HS APU
Compositing
===========
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon Graphics (radeonsi, rembrandt, LLVM 18.1.1, DRM 3.57, 6.8.9-300.fc40.x86_64)
OpenGL version string: 4.6 (Core Profile) Mesa 24.0.6
OpenGL platform interface: EGL
OpenGL shading language version string: 4.60
Driver: Unknown
GPU class: Unknown
OpenGL version: 4.6
GLSL version: 4.60
Mesa version: 24.0.6
X server version: 1.23.2
Linux kernel version: 6.8.9
Direct rendering: Requires strict binding: no
Virtual Machine:  no
OpenGL 2 Shaders are used
Comment 5 Liz Lee 2024-05-12 08:28:05 UTC
Created attachment 169392 [details]
Glitch between window title and content

I can confirm it too.
Scaling is set to 150% in my case.

Fedora 40, Kernel 6.8.9.300.fc40.x86_64, wayland
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0

GRAPHICS INFO
Hardware: AMD Ryzen 6600HS APU
Compositing
===========
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon Graphics (radeonsi, rembrandt, LLVM 18.1.1, DRM 3.57, 6.8.9-300.fc40.x86_64)
OpenGL version string: 4.6 (Core Profile) Mesa 24.0.6
OpenGL platform interface: EGL
OpenGL shading language version string: 4.60
Driver: Unknown
GPU class: Unknown
OpenGL version: 4.6
GLSL version: 4.60
Mesa version: 24.0.6
X server version: 1.23.2
Linux kernel version: 6.8.9
Direct rendering: Requires strict binding: no
Virtual Machine:  no
OpenGL 2 Shaders are used
Comment 6 Liz Lee 2024-05-12 08:30:33 UTC
Additional info:
in my case it only occurs when the window is maximized.

(I'm sorry for my double post above, i'm new here and didn't understand the add attachment function on this website)
Comment 7 Liz Lee 2024-05-26 17:58:08 UTC
Bug still exists after update to plasma 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0
Comment 8 Liz Lee 2024-06-20 12:07:03 UTC
Bug still exists on Plasma Version 6.1.

Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.9.4-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Graphics Processor: AMD Radeon Graphics

OpenGL (EGL) info:
Wayland platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
EGL driver name: radeonsi
(...)
OpenGL core profile vendor: AMD
OpenGL core profile renderer: AMD Radeon Graphics (radeonsi, rembrandt, LLVM 18.1.6, DRM 3.57, 6.9.4-200.fc40.x86_64)
OpenGL core profile version: 4.6 (Core Profile) Mesa 24.1.1
OpenGL core profile shading language version: 4.60


KWin info:
Version
=======
KWin version: 6.1.0
Qt Version: 6.7.1
Qt compile version: 6.7.1
XCB compile version: 1.17.0

Operation Mode: Xwayland

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_X11_XCB: yes
HAVE_GLX: yes
Comment 9 Bug Janitor Service 2024-06-20 16:51:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5950
Comment 10 Zamundaaa 2024-06-26 19:12:16 UTC
*** Bug 486469 has been marked as a duplicate of this bug. ***
Comment 11 Zamundaaa 2024-07-08 11:16:25 UTC
*** Bug 489905 has been marked as a duplicate of this bug. ***
Comment 12 Zamundaaa 2024-07-31 13:46:16 UTC
*** Bug 488357 has been marked as a duplicate of this bug. ***
Comment 13 Liz Lee 2024-08-25 21:59:27 UTC
problem still exists in plasma 6.1.4

Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.6-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 14 Zamundaaa 2024-09-25 15:30:01 UTC
*** Bug 493458 has been marked as a duplicate of this bug. ***
Comment 15 Liz Lee 2024-11-04 09:57:15 UTC
problem still exists in Plasma 6.2.2:

Operating System: Fedora Linux 41
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.11.5-300.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 16 Zamundaaa 2024-12-13 15:39:33 UTC
Git commit 8fa7eedf74259280ad8ebdd0159066728c604fcb by Xaver Hugl.
Committed on 13/12/2024 at 15:13.
Pushed by zamundaaa into branch 'master'.

window: snap sizes to the pixel grid and double buffer decoration state

This ensures that the decoration (as well as other KWin code) gets a logical size that fits
perfectly on the pixel grid. In other words, multiplying it with the scale factor results in
an integer, so there are no gaps or overlaps when using the floating point value in geometry
calculations or painting code.

For example, before, if you had a screen with 200% scale, and a window on it that's 49u wide
with 1px wide decoration borders, the border size in integer logical units would be
    round(1px / 200%) = 1u
and the resulting size
    1u + 49u + 1u = 51u => 51 * 200% = 102px
but the actual pixel size is
    1px + 49u * 200% + 1px = 100px

with this change, the floating point numbers are taken into account, the decoration border is
    1px / 200% = 0.5u
wide and thus the logical window size is
    0.5u + 49u + 0.5u = 50u => 100px
which matches the actual pixel size perfectly.

Similar issues were observable with the window size at non-integer scale factors, which also
get fixed by this commit.

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Related: bug 452438, bug 492052

M  +23   -0    src/core/pixelgrid.h
M  +14   -1    src/decorations/decoratedwindow.cpp
M  +2    -0    src/decorations/decoratedwindow.h
M  +1    -0    src/decorations/decorationbridge.cpp
M  +16   -5    src/inputpanelv1window.cpp
M  +2    -1    src/inputpanelv1window.h
M  +11   -1    src/internalwindow.cpp
M  +2    -0    src/kcms/decoration/declarative-plugin/previewbutton.cpp
M  +10   -0    src/kcms/decoration/declarative-plugin/previewclient.cpp
M  +2    -0    src/kcms/decoration/declarative-plugin/previewclient.h
M  +2    -0    src/kcms/decoration/declarative-plugin/previewitem.cpp
M  +17   -3    src/layershellv1window.cpp
M  +3    -1    src/layershellv1window.h
M  +1    -1    src/plugins/kdecorations/aurorae/src/aurorae.cpp
M  +6    -21   src/scene/decorationitem.cpp
M  +1    -2    src/scene/decorationitem.h
M  +2    -1    src/waylandwindow.cpp
M  +26   -12   src/window.cpp
M  +10   -5    src/window.h
M  +16   -5    src/x11window.cpp
M  +1    -0    src/x11window.h
M  +51   -22   src/xdgshellwindow.cpp
M  +11   -2    src/xdgshellwindow.h

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