shutter-project / shutter

Screenshot tool for Linux
https://shutter-project.org/
GNU General Public License v3.0
521 stars 34 forks source link

Region picked from wrong screen on 4K triple-screen setup *with delay only* #414

Open nocke opened 2 years ago

nocke commented 2 years ago

Brief summary of issue

I have a rather new Lenove P14s 2nd gen and three screens from left to right: built-in 1920×1080, 2× 3840×2160

image

Steps to reproduce the issue

Doing a selection screenshot with no delay (0 seconds at bottom right of dialog) works as expected. Doing a selection screenshot with delay (>0 seconds) picks the wrong of the two 4K screens. (Even when just doing a ↻ re-capture)

I took a rectangular region on the middle screen (catching some green+blue browser content). Without delay I get what I want. With delay it picks same offset, but from the wrong screen: fullscreen

not working workaround: I tried switching the HDMI cables of monitor 1+2. (interestingly, I did not have to compensate for this in monitor preferences by switching there, too (?). Somehow they are re-recognized (smart Ubuntu, smart docking station, I have no idea) anyway: not change.

Note above (not sure if any impact): my built-in, leftmost screen is not top-aligned but bottom-aligned to the others.

Extra information, such as Shutter version, operating system and ideas for how to solve:

Shutter 0.99 Rev.1591 Problems started on Ubuntu-MATE 20.04 (never had any such problem with 16.04, my last version before). Problems persist on Ubuntu-MATE 21.10 (just fully upgraded)

DarthGandalf commented 2 years ago

To clarify: before 20.04 you used the same shutter version?

I suspected I could introduce some issues with multiple screens during recent refactors, but without multiple screens I couldn't verify. I'll need to find some way to emulate multiple screens to reproduce this.

nocke commented 2 years ago

before 20.04 you used the same shutter version? certainly not, I used 0.94 I think (that came with it)

I just check at normal Full HD by the way: All three displays at 1920×1080: problem persists.

Emulating could be done with virtualbox I think, allowing up to 8 (!) displays. I am using 2 in my virtualbox all the time. But sadly only for applications, I am no Linux developer (yet)...

massimo-romano commented 7 months ago

I confirm the same issue in Ubuntu 22.04 on Lenovo P16 Gen 2 and Shutter 0.99.2 Rev.1593 Only if I set a delay in capturing the screenshot and use the Selection feature in Shutter, the selected region is not correct.

However, the problem seems to be related to the fact that in Settings > Displays in Ubuntu, I have a different scale factor from 100% for my primary monitor (in my case 175% for display 1 and 100% for display 2). If I use the delay but have both screens at 100% scale factor, then the screenshot is captured correctly.

hsandt commented 3 months ago

I have a variant, where I have a single 4K monitor (laptop integrated screen), and it keeps picking the wrong region on that screen. Sometimes it would complain about empty region, and once it just didn't show capture at all when trying to capture on the edge on the screen (possibly due to offset sending outside screen edges). I tried to reduce delay to 0 but it seems to clamp the effective delay to minimum 1 or 2s anyway.

And now I tried again but the Enter button does nothing at all so I cannot confirm the region capture. Very weird and the first time it does it, I'll reboot and try again.

Note: Unity desktop's old native screen capture works fine

hsandt commented 3 months ago

I opened a new issue for this since it seems to affect offset and only when using single monitor: https://github.com/shutter-project/shutter/issues/680