wayfire
wayfire copied to clipboard
Fractional scaling creates black lines in the decoration
Describe the bug Fractional scaling creates black the decoration.
To Reproduce Steps to reproduce the behavior:
- Enable plugin decoration.
- Change the scale to a non whole value (may not happen on some values, I'm not sure).
- Black lines show up just under the title bar (1 pixel wide):
Expected behavior Them not showing up.
Speculation I suspect this is being caused by "incorrect layout assignment". What I mean by this is that wayfire, when scaling, applies a simple approximate "size up" to all geometries in the layout.
Dumb solution proposal
Maybe the problem is that, when setting the size for scaled geometries, wayfire is using a simple int
casting of width
and height
times the (double)scale
to get the pixel size. Perhaps it would be wiser to use something like ceil()
? I don't know if this would have any side effects, or if wayfire even does it that way, but this is what came to mind.
Wayfire version 0.7.2-1, git.
Wayfire is supposed to expand the damaged area, do you have a particular place in the code where we simply cast to int? That would likely be a bug.
Maybe here...? https://github.com/WayfireWM/wayfire/blob/master/src/core/output-layout.cpp#L1163-1183 I'm gonna be honest though, I'm not familiar with the code at all, so this probably isn't it
Now that I think about it, floor()
might be a better solution than ceil()
.
Solution for this issue: first transform the damaged region to physical coordinates, and then render that (i.e do not use logic_scissor() in the code, but the barebones scissor()). The problem is that when we have a damage region consisting of multiple rectangles, when we scale them to physical coordinates (and round) there are often times overlaps.