[BUG] Stickers are rendering incorrectly on the lock screen
Submission checklist
- [x] I have searched existing issues and confirmed this is not a duplicate.
- [x] I reproduced this on the latest release of Noctalia.
Bug description
At random times, when I go to the lock screen, it renders the stickers I've added incorrectly
Steps to reproduce
Lock and unlock your device a few times, eventually, the icons will glitch out.
Expected behavior
It should remain consistent without any changes in size
Actual behavior
Sometimes the stickers are too small
Logs / error output
Noctalia version
5.6.0.1 - dirty
Compositor
Niri
Distribution
Arch-based
Environment information
AMD rysem 5 3500u
AMD radeon vega 8 graphics
Additional context
No response
I hit this on 5.6.0 too (niri, Arch-based), on the desktop and on the lock screen. I think I found the cause. It only affects non-square images, and whether you see it depends on how fast the async decode finishes, which would explain why it seems random.
What happens
DesktopStickerWidget::doLayout(src/shell/desktop/widgets/desktop_sticker_widget.cpp:98) sizes the sticker as akDefaultStickerSize(200×200) square untilm_image->hasImage()is true. In 5.6 the decode is async, so the first layout pass measures that 200×200 placeholder.DesktopWidget::layout(src/shell/desktop/desktop_widget.cpp:58-59) records the content size as a high-water mark (m_maxNaturalWidth/m_maxNaturalHeight), and the mark only ever grows.- When the decode lands,
setAsyncReadyCallback → requestLayout()re-lays out the sticker at its real aspect ratio. Width or height drops below 200, but the high-water mark stays at 200×200. SocontentScaleForBoxfits a 200×200 box that doesn't exist anymore, and the sticker draws too small along its short axis.
Example from my setup: a portrait SVG in a 404×1012 box should fill the box. Instead it rendered at about 160×400, because min(404/200, 1012/200) = 2.02, and that scale was applied to an 80×200 natural size.
The lock screen goes through the same DesktopWidgetFactory (lockscreen_widgets_host.cpp:35), so it's the same bug there. When the texture is already cached, the decode is effectively instant and it renders correctly. That matches the "sometimes" in this report.
I checked current main (2951c1a). It still has the same high-water logic and the same 200×200 placeholder. b4b5c16 (file images load only through the async cache) probably makes the bug easier to hit.
Possible fixes
- Reset the high-water mark when the async image arrives (for example, a protected
resetNaturalSizeHighWater()onDesktopWidget, called in the sticker's ready callback beforerequestLayout()), or - Have the sticker skip the high-water mark, the way
DesktopAudioVisualizerWidget::layoutalready does. A sticker's natural size only depends on its aspect ratio, so the "stable font" reason for the high-water mark doesn't apply to it.
Workaround until it's fixed: make the sticker's box square, with each side equal to the longest edge you want. The placeholder pass is square too, so the image comes out the right size.
Hey @lucaphill , this should be solved with the referenced commit. Can you please test it and let us know :)?
In my current workflow, I can't build from source, so I can't test it :( But I hope it worked
@lucaphill I tested it. This commit fixed it, stickers goes back to previous state like same as before. My cats stickers are not small anymore.
It's been a week and no issue still so I am closing this.