[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added See Also||https://bugs.kde.org/show_b ||ug.cgi?id=464069 --- Comment #25 from Nate Graham --- Something similar is happening again; see Bug 464069. :( -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 --- Comment #24 from Nate Graham --- This bug was about text; that's something different. -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Bug Janitor Service changed: What|Removed |Added Priority|NOR |HI -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 --- Comment #23 from Gerhard --- Created attachment 153341 --> https://bugs.kde.org/attachment.cgi?id=153341=edit Buttons with horizontal line offset at 150% scaling -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 --- Comment #22 from Gerhard --- Seems that this bugs has returned with Plasma 5.26.0 with Qt 5.15.6. One example is the mouse/keyboard battery in KInfoCenter (see screenshot). This was definitely fixed before. Reopen? -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added See Also|https://bugs.kde.org/show_b | |ug.cgi?id=432264| --- Comment #21 from Nate Graham --- Bug 432264 isn't related. -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 postix changed: What|Removed |Added CC||pos...@posteo.eu -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 postix changed: What|Removed |Added See Also||https://bugs.kde.org/show_b ||ug.cgi?id=432264 -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added CC||mako...@hotmail.com --- Comment #20 from Nate Graham --- *** Bug 457629 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added CC||ad.liu@gmail.com --- Comment #19 from Nate Graham --- *** Bug 457326 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added Status|CONFIRMED |RESOLVED Resolution|--- |UPSTREAM Version Fixed In||Qt 5.15.3 --- Comment #18 from Nate Graham --- Should be fixed by the fixes for upstream bugs https://bugreports.qt.io/browse/QTBUG-96112 and https://bugreports.qt.io/browse/QTBUG-83626, which is being backported to the KDE patch collection. -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added See Also||https://bugs.kde.org/show_b ||ug.cgi?id=426429 -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added See Also||https://bugs.kde.org/show_b ||ug.cgi?id=435456 -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 --- Comment #17 from santury...@gmail.com --- (In reply to Nate Graham from comment #16) > *** Bug 435456 has been marked as a duplicate of this bug. *** That bug was at default scale -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added CC||santury...@gmail.com --- Comment #16 from Nate Graham --- *** Bug 435456 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added CC||s...@mser.at --- Comment #15 from Nate Graham --- *** Bug 435156 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added CC||gsten...@gmx.net --- Comment #14 from Nate Graham --- *** Bug 434484 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added CC||m.lince...@gmail.com --- Comment #13 from Nate Graham --- *** Bug 434402 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added CC||ricardo.steij...@gmail.com --- Comment #12 from Nate Graham --- *** Bug 433554 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Alex changed: What|Removed |Added CC||alex...@protonmail.com -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Ilya Bizyaev changed: What|Removed |Added CC||bizy...@zoho.com -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added CC||alej0hio2...@gmail.com --- Comment #11 from Nate Graham --- *** Bug 431955 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added CC||thunderbirdtr@fedoraproject ||.org --- Comment #10 from Nate Graham --- *** Bug 432114 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 --- Comment #9 from Nate Graham --- *** Bug 432095 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 --- Comment #8 from nyanpasu64 --- >But I don't really follow what you think is a Qt bug with regards to the >qt_Matrix. It has to do the mapping between co-ordinates, so what would we >change? qt_Matrix is constructed using the output texture's height and width. Its current function is to take a point in device-independent pixels (x-right = 0 .. (w/devicePixelRatio), y-down = 0 .. (h/devicePixelRatio)), and convert it to an OpenGL position (x-right = -1..1, y-up = -1..1) which maps to the the same point (converted to physical pixels) in the output texture. A symbolic description of the procedure is as follows: - Divide x by (w/devicePixelRatio), then multiply by 2 and subtract 1. - Divide y by (h/devicePixelRatio), then multiply by 2 and subtract 1, then negate. However it's currently computed incorrectly, since it rounds w/devicePixelRatio and h/devicePixelRatio (the output texture size converted to device-independent pixels) to an integer. At least that's my understanding of what goes wrong, since I could not find the code that computes qt_Matrix. Also I think this code will break down even worse if I test on Wayland with per-monitor scaling factors (I haven't tested the current code or any of my proposed bugfixes on it, and the current code has some iffy branching off that). >You can set a filtering on the QSGTexture. Nodes will follow that. I tried the following in KQuickStyleItem::updatePaintNode(), and it had no effect (still nearest-neighbor): ``` auto texture = window()->createTextureFromImage(m_image, {}); texture->setFiltering(QSGTexture::Linear); styleNode->setTexture(texture); ``` >Ultimately QQC2-desktop-style is a hack. It's not where we want to be going >long long term for styling, it's far too many texture uploads. It's just there >as we need visual compatibility. Is it worth fixing the bug or not, by quantizing each scene node to physical pixels whenever it moves? (I suspect the current approach will never support rendering scaled/rotated/etc. widgets cleanly. So I have to somehow detect non-translation transformation, turn off quantization, and turn on linear interpolation... which doesn't work right now.) Is https://invent.kde.org/plasma/qqc2-breeze-style mature yet? I don't see any Arch package supplying it. Additionally I think the texture width/height override code is unused. KQuickStyleItem::setTextureWidth() sets m_textureWidth, which gets multiplied by the screen DPI scaling factor when picking a texture width (this feels like a mistake). Moreover, KQuickStyleItem is a library-private class, only used internally as the QML type "org.kde.qqc2desktopstyle.private.StyleItem". And none of the QML files set the textureWidth property, so I think m_textureWidth is always 0 and this part of the code is dead. (Code search: https://invent.kde.org/frameworks/qqc2-desktop-style) -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 --- Comment #7 from David Edmundson --- >since Qt 5.15 is no longer receiving public or open-source updates. We will have no issues getting patches to users. We regularly give patches to distros when upstream releases have issues that don't cover our needs. This is no different. But I don't really follow what you think is a Qt bug with regards to the qt_Matrix. It has to do the mapping between co-ordinates, so what would we change? >Also I was not able to find a way to enable linear filtering for >`KQuickStyleItem`'s returned paint node, You can set a filtering on the QSGTexture. Nodes will follow that. Though ideally our source textures and our output sizes should always match in device sizes, so it shouldn't make a difference. >Additionally I don't know if there's any interest in fixing this bug Ultimately QQC2-desktop-style is a hack. It's not where we want to be going long long term for styling, it's far too many texture uploads. It's just there as we need visual compatibility. -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 --- Comment #6 from nyanpasu64 --- Created attachment 134836 --> https://bugs.kde.org/attachment.cgi?id=134836=edit Video of a Qt Quick 2 button glitching when resized, with patched qqc2-desktop-style I've done a deep-dive investigation, looking into multiple issues and Qt Quick design defects causing this bug's symptoms to occur. For reference, the C++ implementation of the theme is at https://invent.kde.org/frameworks/qqc2-desktop-style/-/blob/7cdeaab75171b4126ba9026875539108a834a577/plugin/kquickstyleitem.cpp. ## Background Qt Quick 2 positions and sizes items in device-independent pixels. `KQuickStyleItem` (defined by qqc2-desktop-style in the above link) is a subclass of `QQuickItem` used to render widgets and output them on-screen. In simple QQC2 apps (like System Settings panels), the position and size of each item are integers in device-independent pixels. Perhaps in more complex apps, the widgets could be translated or rotated, making them no longer integers. When `KQuickStyleItem::updatePolish()` is called, it renders the widget using `QPainter`/`QStyle` onto a member-variable `QImage m_image`. (Note that this is an abuse of updatePolish() which is intended to relayout and not redraw.) When `KQuickStyleItem::updatePaintNode()` is called, it uploads the `QImage` to a GPU texture, and outputs a scene graph item (`QSGNinePatchNode *` upcasted to `QSGNode *`) pointing to the texture. Qt Quick 2 turns it into a rectangle (two tris) and sends the mesh/texture to OpenGL. The size and position of the `KQuickStyleItem`/`QQuickItem` is not determined by `KQuickStyleItem::updatePaintNode()` or `KQuickStyleItem::updatePolish()`, but merely consumed. `QQuickItem::boundingRect()` is an undocumented method used in `KQuickStyleItem::updatePaintNode()` (and assumed to match `width()`/`height()` which is what `updatePolish()` uses). Based on my debug prints, `boundingRect()` returns a rectangle where the top-left lies at (0, 0), even if the item does not lie at the window's origin. You need to use `mapToGlobal()` to find the true position in the window. By running RenderDoc on QQC2 apps (kcm_fonts and a single-button test app), I found that the rectangle's coordinates are sent to OpenGL as device-independent pixels (`qt_VertexPosition`), and the vertex shader transforms them into `gl_Position` coordinates. Then it samples the texture using nearest-neighbor interpolation, even if you modify the `createTextureFromImage()` value by calling `setFiltering(QSGTexture::Linear)`. I was unable to get RenderDoc to replay the trace with linear filtering enabled. ## Bug There are multiple layers of bugs: 1. With DPI display scaling enabled, the polygon drawn on the GPU, as well as the region used by mouse handling, no longer lies on integer physical pixels. The visual polygon's size may not match the QImage's size. - I "fixed" this by having `KQuickStyleItem::updatePaintNode()` return a scene-graph node which matches the QImage's size and not the `QQuickItem`'s size (a). 2. Even if the visual polygon's size is an integer number of physical pixels, the x or y coordinates can lie on a 0.5-pixel boundary. This causes rounding errors and sometimes results in the "diagonal seam" effect (and might also cause duplicated/missing rows/columns) where the two triangles of the rectangle round their boundaries and texture coordinates differently. With `QQuickWindow::TextureCanUseAtlas` in place, the diagonal seam effect is inconsistent, doesn't appear in all buttons, and can appear/disappear when you hover a button (because many `KQuickStyleItem`s are placed onto a single texture uploaded to the GPU, resulting in inconsistent rounding). With that parameter removed (b), the effect is consistent and appears in all buttons with the same x or y endpoints, in both hovered/unhovered states. - I recorded and attached a video demonstrating this bug occurring when I resize a window, with a patched version of qqc2-desktop-style which sets the returned node's size to the QImage's size in physical pixels (a) and also disables Qt's texture atlas (b). I saw both duplicated rows/columns of pixels and diagonal seams. - I don't know the best fix for this. I had a branch where `KQuickStyleItem::updatePaintNode()` used `mapToGlobal` and `mapFromGlobal` to quantize the output polygon to global physical pixels (c). However, this method is only called when a widget is hovered, not upon window resize (which also changes the widget's position and affects pixel rounding), so it's not a workable solution. Worse yet, this solution fails completely if you rotate a widget (but I suspect the current qqc2 theme had the same behavior). Also I was not able to find a way to enable linear filtering for `KQuickStyleItem`'s returned paint node, which would cause non-integer nodes/items to be blurry and ugly, but obviously stand out and not have diagonal/horizontal/vertical seams. 3. I made a test QQC2
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 --- Comment #5 from nyanpasu64 --- Created attachment 134768 --> https://bugs.kde.org/attachment.cgi?id=134768=edit Button with diagonal seam due to 125% scaling I'm running KDE at 125% display scaling, and I've experienced this problem in Kirigami-based KDE settings panels for months now. When writing a simple QML app of my own, I came across this interesting issue where instead of a horizontal row of duplicated or missing pixels, the image has a diagonal seam, running from the bottom-left of the text to the top-right. For the screenshot, I produced a button using all | characters to make the seam more obvious. The seam disappears when I press Alt (also causing the left border of the button to have 1 less duplicated pixel), or if I add enough | characters to stretch the button horizontally. The border rendering is also quite bad to be honest, with duplicated pixels and fuzzy lines. Is the diagonal seam caused by inconsistent rounding when dividing the button into triangles to be drawn? Is it a different root cause than the horizontal duplicated rows? -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 nyanpasu64 changed: What|Removed |Added CC||nyanpas...@tuta.io -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 --- Comment #4 from Nate Graham --- Found it. -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 --- Comment #3 from Nate Graham --- *** Bug 405145 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 --- Comment #2 from Nate Graham --- *** Bug 414265 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added See Also|https://bugs.kde.org/show_b | |ug.cgi?id=414265| -- You are receiving this mail because: You are watching all bug changes.
[frameworks-qqc2-desktop-style] [Bug 414266] Certain (not all) QQC2 buttons have vertically stretched and pixellated text when fractional display scaling is used
https://bugs.kde.org/show_bug.cgi?id=414266 Nate Graham changed: What|Removed |Added Assignee|now...@gmail.com|notm...@gmail.com CC||k...@davidedmundson.co.uk, ||n...@kde.org Component|kcm |general Ever confirmed|0 |1 Summary|"Default device" buttons|Certain (not all) QQC2 |has badly rendered font if |buttons have vertically |fractional display scaling |stretched and pixellated |is used |text when fractional ||display scaling is used Product|plasma-pa |frameworks-qqc2-desktop-sty ||le Status|REPORTED|CONFIRMED See Also||https://bugs.kde.org/show_b ||ug.cgi?id=414265 Version|5.17.3 |5.64.0 --- Comment #1 from Nate Graham --- Seems like an issue in the QQC2 desktop style (or maybe in Qt itself, but let's start there). Very visible in the KCMs in System Settings' Appearance section. I recall another bug you filed about this issue in some KCM. If you can find it, can you mark it as a duplicate of this one? Thanks! -- You are receiving this mail because: You are watching all bug changes.