flameshot-org / flameshot

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

Text is rendered incorrectly when using 200% scale #3431

Open vdmit opened 11 months ago

vdmit commented 11 months ago

Flameshot Version

$ flameshot --version
Flameshot v11.0.0 (11.0.0-2 Debian)
Compiled with Qt 5.15.2

Installation Type

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

Operating System type and version

Ubuntu 22.04.3 LTS

Description

I have a laptop plus standalone display with different scaling on each screen. Laptop has 1x scale, and 4k external display with 2x scale (200%). I prefer single-display mode.

When I start flameshot on laptop with disconnected display, all works fine, BUT when I connect it to display and switch to it, Flameshot renders texts incorrectly (texts could "fly away" from frame). And, vice versa, if I start flameshot in 200% mode and then switch to internal display, texts also will be mis-positioned.

I've found a simple workaround: just restart flameshot after monitor connection/disconnection, but this is boring.

Steps to reproduce

  1. configure 2-monitor mode with different screen scale and single-display mode screenshot-2023-12-06_11-29 (e.g. 100% and 200%)
  2. start flameshot
  3. change screen scale (e.g. by connecting /disconnecting external display)
  4. take a screenshot and try to draw some text
  5. After switching to another tool (or screen saving) text will be misplaced: to the left if scale has increased, and to the right if scale decreased.

Screenshots or screen recordings

Good screen: screenshot-2023-12-06_11-15 Bad screen after display switching: Screenshot from 2023-12-06 11-18-34

System Information

$ inxi --width 80 --system --graphics
System:
  Host: vdmit-ix Kernel: 6.2.0-37-generic x86_64 bits: 64 Desktop: GNOME 42.9
    Distro: Ubuntu 22.04.3 LTS (Jammy Jellyfish)
Use of uninitialized value in concatenation (.) or string at /usr/bin/inxi line 13826.
Graphics:
  Device-1: Intel Alder Lake-P Integrated Graphics driver: i915 v: kernel
  Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: modesetting
    unloaded: fbdev,vesa gpu: i915 s-res: 3840x2160~Hz resolution: 3840x2160
  OpenGL: renderer: Mesa Intel Graphics (ADL GT2)
    v: 4.6 Mesa 23.0.4-0ubuntu1~22.04.1
$ xrandr --listactivemonitors
Monitors: 1
 0: +*DP-3-2 3840/597x2160/336+0+0  DP-3-2
mschout commented 10 months ago

I can confirm this is a problem. Same thing happens for me at 200%.

mschout commented 10 months ago

Although, oddly enough, I recompiled it from source and the problem seems to have gone away. Strange.

stevgouws commented 8 months ago

Same for me on Windows 10. Restarting Flameshot works.

Flameshot v12.1.0 (96c2c82e) Compiled with Qt 5.15.2 winnt: 10.0.19045 windows: 10

mschout commented 7 months ago

It happens for me often. I think the reason "reinstalling" fixed it temporarily was that it was because it restarted.