flameshot-org / flameshot

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:
https://flameshot.org
GNU General Public License v3.0
25.01k stars 1.6k forks source link

Color picker position differs from cursor position when using QT scaling #3006

Open FuryBart opened 1 year ago

FuryBart commented 1 year ago

Flameshot Version

Flameshot v12.1.0 (96c2c82e) Compiled with Qt 5.15.2

Installation Type

Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)

Operating System type and version

winnt: 10.0.19045 windows: 10

Description

I was playing around (in Windows) with scaling up flameshot on high resolution monitors using a vbs script to set the QT parameters. Set objShell = CreateObject("WScript.Shell") objShell.run("cmd.exe /C set QT_AUTO_SCREEN_SCALE_FACTOR=1 & set QT_SCALE_FACTOR=2 & ""<path>\flameshot.exe"""),0 (Btw. The vbs wrapper is only needed to hide the cmd windows. For an unknown reason the cmd /C parameter does not work as it should with flameshot. The cmd windows remains open.)

The upscaling works very well, but there is an problem with the position of the color picker. Cursor position and color picker position differs by the QT scaling factor.

Steps to reproduce

  1. run "flamshot" with upscaling QT factor
  2. select a region and go the tools and the color picker
  3. As far as I could find out, you start with the coordinates 0,0 in the upper left corner of the screen. If you move the mouse cursor to the position 100,100, you get the color of the position 50,50.

System Information

winnt: 10.0.19045 windows: 10

FuryBart commented 1 year ago

Here is a picture to illustrate it. On the left side you see a 200x200px red square inside a 400x400px blue square. When the mouse cursor selects the Position (1), the color picker gets the color of the position (2). See the color picker details on the right side. flameshot_picker_pos

emiham commented 7 months ago

I've had this problem on Linux for a while. For anyone else running into this, you can fix it by resetting those two environment variables before running flameshot, i.e. QT_SCREEN_SCALE_FACTORS=1 QT_AUTO_SCREEN_SCALE_FACTOR=0 flameshot gui.