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

Zamundaaa <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|                            |https://invent.kde.org/plas
                   |                            |ma/kwin/-/commit/8fa7eedf74
                   |                            |259280ad8ebdd0159066728c604
                   |                            |fcb
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #16 from Zamundaaa <[email protected]> ---
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 <[email protected]>
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

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

Reply via email to