| Summary: | X11Output does not have its scale set | ||
|---|---|---|---|
| Product: | [Plasma] kwin | Reporter: | Noah Davis <noahadvs> |
| Component: | general | Assignee: | KWin default assignee <kwin-bugs-null> |
| Status: | RESOLVED INTENTIONAL | ||
| Severity: | normal | CC: | kde, nate |
| Priority: | NOR | ||
| Version First Reported In: | git master | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Noah Davis
2023-09-22 01:04:04 UTC
In `QFuture<QImage> ScreenShotEffect::scheduleScreenShot(const QRect &area, ScreenShotFlags flags)`, if I use QScreen::devicePixelRatio() to get the screen scales, then the returned image is correct. It currently uses KWin::EffectScreen::devicePixelRatio(), which gets its value from the scale for the platform dependent KWin::Output subclass. 1.0 is expected.
Logical and device pixels are the same.
Can you expand on
>to return an incorrect image
(In reply to David Edmundson from comment #2) > 1.0 is expected. > Logical and device pixels are the same. > > Can you expand on > > >to return an incorrect image The image is smaller than it should be and doesn't actually contain the whole workspace. For example, let's say you have two 1920x1080 screens horizontally next to each other with 1.25x scale. The unscaled virtual desktop size is 3840x1080. If you get an image of the whole workspace, you get a 3072x864 image with the right and bottom parts of the workspace cut off. This is different from the behavior on Wayland where the image dimensions match the unscaled virtual desktop size and the image contains the entire workspace. I looked at the code and the reason why is because WaylandOutput gives a correct device pixel ratio, but the X11Output does not, even though QScreen gives a correct device pixel ratio on X11. I think QScreen has different results from X11Output because plasma-workspace/startkde/startplasma-x11.cpp sets QT_SCREEN_SCALE_FACTORS using the settings defined using the Display Configuration KCM. X11Output::scale() returning 1 on X11 is fully intentional and I'm afraid that we cannot change it as it's going to have some repercussions. Maybe spectacle needs to handle this case somehow. --- Removing qt6 because it's not really a new Plasma 6 issue. kwin has been behaving like this forever. (In reply to Vlad Zahorodnii from comment #4) > X11Output::scale() returning 1 on X11 is fully intentional and I'm afraid > that we cannot change it as it's going to have some repercussions. Maybe > spectacle needs to handle this case somehow. > > --- > > Removing qt6 because it's not really a new Plasma 6 issue. kwin has been > behaving like this forever. Spectacle can't handle it because the image it gets is faulty, as described above. The issue only occurs on X11 with scaling. I suppose we could make the ScreenShot2 effect use QScreen instead of EffectScreen to get screen geometry. |