D12804: Fix window frame rounding when scaling is used
Alex Nemeth
noreply at phabricator.kde.org
Fri Jul 13 23:59:22 BST 2018
anemeth added a comment.
As others said the dpi scaling should normally be dealt with `QImage::setDevicePixelRatio()`
As far as I can tell this is not working with Breeze for the following reason:
The decoration rendering starts here: https://github.com/KDE/kwin/blob/master/decorations/decorationrenderer.cpp#L66
The dpi is set here correctly with `QImage::setDevicePixelRatio()`
However this dpi value here is incorrect.
`client()->client()->screenScale()` is defined here: https://github.com/KDE/kwin/blob/master/toplevel.cpp#L316 and gets the value from here: https://github.com/KDE/kwin/blob/master/toplevel.cpp#L277
And in that function `qreal newScale = screens()->scale(m_screen);` gets the value from here: https://github.com/KDE/kwin/blob/master/screens.cpp#L114
You can see that this function just returns 1, and because of this the devicepixelratio of the decoration QImage will always be 1.
If I set Plasma scaling to 2 and change this value to 2 or the devicepixelratio here https://github.com/KDE/kwin/blob/master/decorations/decorationrenderer.cpp#L69 to 2 then the decoration renders very incorrectly.
We already have a workaround in Breeze for this in some parts. For example here https://github.com/KDE/breeze/blob/master/kdecoration/breezebutton.cpp#L166 when rendering the buttons for Breeze decoration we scale the QPainter manually.
This patch adds another workaround, but gets the job done, and as fixing this whole thing would be a big effort.
REPOSITORY
R31 Breeze
REVISION DETAIL
https://phabricator.kde.org/D12804
To: anemeth, #breeze, #vdg, hpereiradacosta, davidedmundson
Cc: zzag, davidedmundson, ngraham, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180713/abcd264f/attachment.html>
More information about the Plasma-devel
mailing list