shutter-project / shutter

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

Region picked from 4K screen is wrong, all corner coordinates are doubled - out of screen dimensions causes zero width / height error #680

Open hsandt opened 3 days ago

hsandt commented 3 days ago

Brief summary of issue

When capturing a region screenshot from a 4K screen, the rectangle corner coordinates are all incorrectly doubled, leading to a bigger rectangle and on the wrong position.

Below, a drawing of the original intended capture in green, and the bigger red rectangle showing the actual capture, offset toward the bottom-right.

2024-06-26 4K capture doubles coords - drawing

If the red rectangle hits the bottom-right limit then you even get an error:

Failed Error: selection widht or height is zero, please retry!

2024-06-26 4K capture doubles coords - outside screen fails with error selection zero

Steps to reproduce the issue

  1. Use single 4K monitor
  2. Shutter: Rectangular selection capture
  3. Select a region in the top-left quarter => offset and bigger capture
  4. Select a region in the bottom-right quarter => "zero" error

Error output

On step 4 only:

Failed Error: selection widht or height is zero, please retry!

Extra information, such as Shutter version, display server in use (Xorg or Wayland), operating system and ideas for how to solve:

0.99.5 Rev.1783 (custom repo copy, master branch, 2024-04-02 23:19, commit bce8db87)

Linux Ubuntu 22.04, Xorg

hsandt commented 2 days ago

For multi-monitor: see this issue where the offset stays the same but wrong monitor is used: https://github.com/shutter-project/shutter/issues/414

It's also possible that doubling coordinates makes the selection move across one monitor to the other!

hsandt commented 2 days ago

Note: in comparison, Ubuntu Unity desktop native screenshot app fails on full screenshot with the reverse issue, it captures only the top-left quarter of the screen, but its Window and Rectangle selection work fine.