| Summary: | Lower-right corner borders (window outline) are buggy in Wayland session | ||
|---|---|---|---|
| Product: | [Plasma] kwin | Reporter: | jys1670 <jys1670> |
| Component: | decorations | Assignee: | KWin default assignee <kwin-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | akselmo, nate, xaver.hugl |
| Priority: | NOR | ||
| Version First Reported In: | 6.1.4 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/plasma/kwin/-/commit/8fa7eedf74259280ad8ebdd0159066728c604fcb | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
| Attachments: | non-uniform window borders | ||
|
Description
jys1670
2024-08-22 22:45:49 UTC
This might resolve the issue https://invent.kde.org/plasma/kwin/-/merge_requests/5950 If you drag the window left/right, it's possible to notice that the border is actually rendered, but at the wrong position? Similar to these tiny gaps problems. Yes, it should fix this 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 483338, bug 452438
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
|