https://bugs.kde.org/show_bug.cgi?id=488233

            Bug ID: 488233
           Summary: [wayland] Rectangle Region Recordings Have Incorrect
                    Resolution on Scaled Displays
    Classification: Applications
           Product: Spectacle
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: General
          Assignee: noaha...@gmail.com
          Reporter: eamonn...@protonmail.com
                CC: k...@david-redondo.de
  Target Milestone: ---

SUMMARY
Rectangle Region Recordings have incorrect resolution on scaled displays.

A region taking up most of a 3840x2160 display @ 150% scaling will have a
resolution of approximately 5,000 across by 2,800 pixels down.

Region screenshots have a very similar problem, except that affects scaled and
unscaled displays. In the case of screen recordings, the resolution is correct
for recordings on non-scaled displays.

The compression used (or default compression settings if it's configurable?)
means that the filesize and video quality are not particularly adversely
affected here, so it is not as much of an issue.

There is a similar issue with Single-Window recordings, but I will report that
separately as the resolution problem is different.

It is worth noting that single screen recordings ("Record Screen") work
correctly and use the correct resolution.

STEPS TO REPRODUCE
1. Record a Region Screenshot on a scaled display.
2. Save it.
3. The resolution will be incorrect.

OBSERVED RESULT
The resolution for Rectangle Region Recordings is incorrect.

EXPECTED RESULT
The resolution for Rectangle Region Recordings should be the same resolution as
though the Screen recording resolution were cropped down.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.9.3 Linux Zen
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
I took a look at the codebase out of curiosity. C++ is outside of my
wheelhouse, doubly so for anything specific to Qt/Wayland (although I am hoping
to learn more overtime as it is a fascination of mine!). I'm not saying I found
anything here that should be fixed, more that for my own understanding of what
the problem is I wanted to point to a few areas in the code :-)
- For Screen recordings (which call Screencasting::createOutputStream), it
looks like the native wl_output is used, which I guess returns the raw
3840x2160
(https://invent.kde.org/graphics/spectacle/-/blob/3f6c5b6c7207959221d225ea0c6d0b03c82fa16f/src/Platforms/screencasting.cpp#L101).
I guess this is why single-screen recordings work?
- For Region recordings (which calls Screencasting::createRegionStream) it
seems to use the QScreen(?) geometry which is then increased by the scaling.
However I think QScreen geometry might be returning 2560x1440 for the
width/height (which is the 150% scaled value of my 3840x2160 display), which is
then multiplied by a scale factor of 2 (instead of 1.5, possibly intentionally,
given the use of std::max
(https://invent.kde.org/graphics/spectacle/-/blob/3f6c5b6c7207959221d225ea0c6d0b03c82fa16f/src/Platforms/VideoPlatformWayland.cpp#L192)),
which would give 5120 and that would line up with my approximate 5,000x2,800
resolution (allowing for the fact that my region didn't encompass the entire
screen and had some margin on all sides).
    - I guess a sub-question here if the scale factor is rounded up is, why?
Something specific to rounding pixels with fractional-scale-v1? If so, once
implemented in Qt and Plasma, could fractional-scale-v2 also fix this the same
way it can fix other issues with fractional scales? As many Wayland devs
evangelise, "screens don't have fractional pixels" so perhaps that's the
reasoning of the rounding here? I'm not saying it's wrong, you and the KDE
folks know better than me for sure, just wondering!
- For Window recordings, I'm not sure, I couldn't find how that part works (I
got as far as here:
https://invent.kde.org/graphics/spectacle/-/blob/3f6c5b6c7207959221d225ea0c6d0b03c82fa16f/src/Platforms/screencasting.cpp#L121).
Although my guess would be that it uses QScreen geometry without any scaling,
which is why a window maximised on my scaled display would give 2560x1440,
since unscaled QScreen geometry may be returning that value?

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to