Bug 460918 - Screenshot only contains bottom-left quarter in 200% scaled Wayland session
Summary: Screenshot only contains bottom-left quarter in 200% scaled Wayland session
Status: REPORTED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (show other bugs)
Version: 5.26.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-24 04:55 UTC by hexchain
Modified: 2023-02-02 14:47 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
what I get (1.60 MB, image/png)
2023-02-01 19:34 UTC, Aleix Pol
Details
The buggy screenshot (313.10 KB, image/png)
2023-02-02 03:47 UTC, hexchain
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hexchain 2022-10-24 04:55:01 UTC
SUMMARY
Taking a screenshot through Portal returns an image file only containing the bottom left quarter of the screen in a 200% scaled Wayland session.

STEPS TO REPRODUCE
1. Take a screenshot through the Portal interface.
2. Inspect the returned image file.

OBSERVED RESULT
The image file is 1440x900 pixels in size and only contains the bottom-left quarter.

EXPECTED RESULT
The image file should be 2880x1800 and contain all of the screen.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.26.1
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Kernel Version: 6.0.3-zen2-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 PRO 6860Z with Radeon Graphics
Memory: 30.1 GiB of RAM
Graphics Processor: REMBRANDT

ADDITIONAL INFORMATION
kscreen-doctor -o:
Output: 1 SDC eDP-1-unknown enabled connected primary Panel Modes: 0:2880x1800@60*! 1:1920x1200@60 2:1920x1080@60 3:1600x1200@60 4:1680x1050@60 5:1280x1024@60 6:1440x900@60 7:1280x800@60 8:1280x720@60 9:1024x768@60 10:800x600@60 11:640x480@60 12:2560x1600@60 13:2880x1620@60 14:1600x900@60 Geometry: 0,0 1440x900 Scale: 2 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown primary
Comment 1 Nate Graham 2022-10-24 18:24:34 UTC
With a 4k screen at 200% scale, I cannot reproduce this issue myself using the xdg-portal-test-kde testing app.
Comment 2 hexchain 2022-10-25 02:58:04 UTC
(In reply to Nate Graham from comment #1)
> With a 4k screen at 200% scale, I cannot reproduce this issue myself using
> the xdg-portal-test-kde testing app.

Where can I find this app?
Comment 3 hexchain 2022-10-25 05:05:03 UTC
Never mind, I found it. But with this app I still get the exact same result.
Comment 4 hexchain 2023-01-31 14:23:19 UTC
In Plasma 5.26.90, taking a screenshot through xdg-portal-test-kde (either inside or outside flatpak) on a 3840x2160 200% screen gives me a picture of the whole screen but scaled down to 1080p. Is this the correct/intended behavior?
Comment 5 Aleix Pol 2023-02-01 19:34:22 UTC
Created attachment 155857 [details]
what I get

I cannot reproduce, the image seems to be the correct resolution (that is on master, so please compare with 5.27 at least).

I wonder if we could/should just be launching spectacle here, this looks a bit ridiculous...
Comment 6 hexchain 2023-02-02 03:47:44 UTC
Created attachment 155868 [details]
The buggy screenshot

This is what I have with xdg-desktop-portal-kde 5.26.90.
Comment 7 hexchain 2023-02-02 14:47:42 UTC
I see where the problem is. In your screenshot, the area is set to "Current Screen", which makes the portal call org.kde.kwin.Screenshot.screenshotScreen(fd, bool). Inside this method in KWin, the screenshot flag is initialized with ScreenShotNativeResolution, and the result buffer is scaled according to dpr.

If the area is "Full Screen", the portal will call screenshotFullscreen(fd, bool), which does not have the native resolution flag, so the result buffer will be the same as the logical size.