| Summary: | Expose global Wayland screen offsets of top-left of all given KDecoration2 geometries for pixel-snapping with fractional scaling | ||
|---|---|---|---|
| Product: | [Plasma] kwin | Reporter: | Paul McAuley <kde> |
| Component: | decorations | Assignee: | KWin default assignee <kwin-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | wishlist | CC: | kde |
| Priority: | NOR | ||
| Version First Reported In: | 5.27.9 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Other | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Paul McAuley
2024-01-12 18:02:24 UTC
We've jumped a few steps, let's back up from proposing solutions. All decoration content is snapped to the pixel grid when we render. As long as you render at the provided for and align within the buffer you write to, everything should be fine. If that's not the case, we need to investigate. (In reply to David Edmundson from comment #1) > We've jumped a few steps, let's back up from proposing solutions. > > All decoration content is snapped to the pixel grid when we render. As long > as you render at the provided for and align within the buffer you write to, > everything should be fine. If that's not the case, we need to investigate. OK, thanks for your reply David. I'll double-check on the latest Plasma code at the weekend and check to see if decoration button icon snapping is good at all scales and report back. Admittedly, my understanding is from when I last looked at this in detail at the time of Plasma 5.26. Would you know in what release this pixel-snapping of decoration was introduced? What reference geometry is snapped to a grid? I assume KDecoration2::Decoration::rect()? Is KDecoration2::DecorationShadow::innerShadowRect() also snapped? Regards I can confirm that my pixel-snapping algorithm is now working for all fractional scales on Plasma 5.27.9 and all are sharp! Good job - snapping the decoration must have been a change in 5.27, or one of its point-releases, that went by me. I also changed my zero whole-pixel reference-point to be the deviceTransform map of KDecoration2::Decoration::rect().topLeft(). I hope this is the correct snapped point - would be good to confirm. ( https://github.com/paulmcauley/klassy/commit/3d829ae8a179463dbaee8faa9321a0df254040a3 ) (Also, ignore my previous comment on innerShadowRect() - I was writing away from a computer and had forgotten the detail on how a shadow was implemented) |