pop-os / cosmic-screenshot

Utility for capturing screenshots via XDG Desktop Portal
GNU General Public License v3.0
20 stars 8 forks source link

Does not accurately capture selection on scaled outputs. #11

Closed XV-02 closed 3 months ago

XV-02 commented 5 months ago

While attempting to take screenshots for a scaling related issue for another Cosmic DE component, I noticed that cosmic-screenshot would not correctly capture the selected areas. I will need to look at how display- and window- capture modes behave as well.

I was attempting to capture the right half (excluding the dock) of my desktop at three scales: 75%, 100%, and 125%.

In the 100% scaled screenshot, the area selected is correctly captured:

screenshot-2024-02-24-00-35-40

In the 75% screenshot, the image does not capture the clock, and is over-provisioned (screenshot captures the excess as transparent. I have filled it as light grey to prevent the image being truncated in-line). Effectively both the left and right edges have been shifted rightwards by what I suspect is a linear multiple of the relative positions of the scaled pixels compared with the screen's actual pixel space. screenshot-2024-02-24-00-35-04_mod

In the 125% screenshot, the image does not capture the screenedge desired, and the capture spills over to the left of the selected area, indicating that the frame has at least shifted leftwards. The height captured is also shorter than was selected in the screenshot tool. However, the top edge of the image is at the top of the display, which the selection should be. screenshot-2024-02-24-00-36-04

On all three screeshots, the area was selected by dragging the selection box from top-left to bottom-right. I have yet to test whether the direction of selection will have an impact.

XV-02 commented 5 months ago

I would note that this seems to be the same issue as reported in https://github.com/pop-os/cosmic-screenshot/issues/5

XV-02 commented 5 months ago

Individual window selection and full screen selection on scaled displays seems to be working as desired, I would note. It looks only to be an issue for arbitrary drag-box selection. It doesn't seem that the directionality of dragging the selection makes a difference.

ryanabx commented 5 months ago

I have the same issue on 200% scaling, and yes, it is exclusive to selecting a section to screenshot.

XV-02 commented 3 months ago

It appears that, as of at least https://github.com/pop-os/cosmic-screenshot/commit/a8130eb9dc74ea8720240e3890a87b1fbe7f234f this has been resolved.