https://bugs.kde.org/show_bug.cgi?id=502047
Jonas Ryssel <burner+...@knyffen.dk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burner+...@knyffen.dk --- Comment #18 from Jonas Ryssel <burner+...@knyffen.dk> --- Created attachment 180662 --> https://bugs.kde.org/attachment.cgi?id=180662&action=edit Display arrangement used to reproduce bug, with a marked section of where to take a screenshot. I think I have figured out the root cause... or something close to it. ---- How to forcibly recreate the issue on any PC ---- 1. Have a setup with 2 (or more) displays. 2. In the "display configuration" settings place your displays so that they are overlapping, and with one of them being larger than the other/sticking out to a side. Using display scaling to make one display much larger than the other is an easy way to make them stick out. 3. Open the rectangular region select in spectacle, and select an area which is only shown on one display (i.e. in the part that is sticking out). I've had success based on which part of which display is sticking out, and if I select an area to the top/bottom/left/right of the inner display. So if it doesn't work, swap which display is large and which is small. (See the attached picture, if my explanation isn't clear. The red rectangle is the area that I try to take a screenshot of.) ---- Why it happens (seemingly) randomly ---- I have a strong suspicion that sometimes KWin and Spectacle disagree on the resolution of displays when using fractional scaling. With my setup (where the bug is present) `the display is set to 2560x2880 with 150% scaling. If I take a full screen screenshot using the "current screen" option in spectacle, the resolution is 2561x1440. This suggests that spectacle (or QT or something else) thinks that the display is 1 pixel wider than what KWin thinks, and if I then place that display to the left, the displays will overlap by 1 pixel, causing the issue. ---- My (unqualified) guess on what causes the issue / what to look for in the code ---- I think there are two bugs which would fix this issue, and I don't know which one is easier to fix (probably nr. 1). 1. There is a math issue somewhere in the code (duh!). In my tests the issue only seems to be present when `resolution/scaling factor` calculation results in the fractional part being above .5 (i.e. it would be rounded up), which suggests a rounding error... I have however also found a case where the faction is above .5 and the bug isn't present, so it is only a hunch. I guess this relates to how "weird" resolutions causes the issue. I have another PC setup where I couldn't reproduce the issue, but once I switched to a 1368x768 resolution, it became much easier to reproduce it without purposefully overlapping the displays. 2. If you have overlapping displays, Spectacle seemingly takes your mouse offset relative to the top left corner of one display, then selects an area with the same offset but relative to the other display's top left corner. Sorry for rambling ;) -- You are receiving this mail because: You are watching all bug changes.