flameshot icon indicating copy to clipboard operation
flameshot copied to clipboard

overlay displaced on multiple displays with different resolutions

Open TilBlechschmidt opened this issue 7 years ago • 24 comments

Okay, so it might be an issue regarding both ultrawide monitors (speaking of 2.35:1) and multiple displays. When taking a screenshot on such setups it basically creates a misplaced overlay across the screen which contains the correct content but is offset by some value. img-2017-07-03-213452 On the left used to be another chrome window (right edge still visible) but instead the overlay which is supposed to be centered is offset to the left. Again I don't know if it is a bug related to multiple monitors or to ultrawides since I don't have another monitor hooked up currently but it might still mess things up since my xorg config includes some variables regarding it.

TilBlechschmidt avatar Jul 03 '17 19:07 TilBlechschmidt

I'm unable to test with multiple monitors right now but I'll try to do it as soon as I can. I'll create a new branch of experimental support for hidpi and multi-monitor configurations. This requires a lot of investigation/testing because this kind of changes could break actual working configurations.

lupoDharkael avatar Jul 04 '17 12:07 lupoDharkael

https://github.com/lupoDharkael/flameshot/issues/2#issuecomment-314707988

lupoDharkael avatar Jul 12 '17 09:07 lupoDharkael

it should be fixed if you test it from the master branch. Please tell me if it works with your hardware.

lupoDharkael avatar Jul 12 '17 19:07 lupoDharkael

I just tested the master branch (specifically commit 07e1df1c50ef796b8c7a67519fd0212d74445c9a ) and the result still matches the above image. Some more context:

  • i3wm
  • ArchLinux
  • 21:9 Monitor (3440x1440)

One thing I just noticed in arandr: img-2017-07-13-191310 There is some padding to the left of my screen (basically its position is at X = 1920) due to the (currently not connected) second monitor. That might be causing the issue since the shift of the screenshot roughly matches the padding.

Edit: XRandr says the following DP-2 connected primary 3440x1440+1920+0

TilBlechschmidt avatar Jul 13 '17 17:07 TilBlechschmidt

The screen grab seems to work ok now. The problem seems that your system has some kind of virtual screen and it's being grabbed within the physical screen. The problem is that Flameshot sets the grabbed screen starting from the first physical monitor in the the coord (0, 0). This can be fixed analysing the offsets of the screens. I need to find hot to recreate something like this in order to start testing a solution.

lupoDharkael avatar Jul 14 '17 11:07 lupoDharkael

This is why I started to get involved in Flameshot. The oldest issue btw. :)

Will definitely look into this!

My Setup from left to right: 1920x1080 external monitor - 1920x1080 external monitor - 1280x720 laptop screen

(sorry for the bad quality - a little bit unprofessional but the best method to get the real thing I see across)

left mid right

Martin-Eckleben avatar Sep 05 '20 18:09 Martin-Eckleben

No ARandR padding for me.

image

EDIT1: Does not always happen. For some reason right now its not happening with 0.6.0 - but with current master - but the offset direction is reversed.

Screenshot_2020-09-05_22-25-00

EDIT2: Unplugged my external screens (one VGA, one DP) for other stuff - replugged them - error not reproducible anymore neither with master nor with 0.6.0 :)

Martin-Eckleben avatar Sep 05 '20 18:09 Martin-Eckleben

I am fairly sure this is related to fractional scaling. I have been digging into it.

borgmanJeremy avatar Nov 01 '20 01:11 borgmanJeremy

我也遇到了,截屏时整个屏幕往左平移了

EchoGroot avatar Nov 26 '20 03:11 EchoGroot

我也遇到了,截屏时整个屏幕往左平移了

找到原因了,屏幕缩放之前是1.25,就有问题。还原到1.0就正常了

EchoGroot avatar Nov 27 '20 11:11 EchoGroot

I have a 1920x1200 monitor (left of main, portrait mode) and a 2560x1600 monitor (main display). Both are not scaled. Flameshot only shows overlay on the leftmost display. The issue doesn't seem to have anything to do with fractional scaling.

This system is running Fedora 33 Wayland session.

skewty avatar Feb 09 '21 21:02 skewty

@skewty can you try building from source on the master branch? I recently merged something to help with wayland.

borgmanJeremy avatar Feb 09 '21 21:02 borgmanJeremy

@skewty can you try building from source on the master branch? I recently merged something to help with wayland.

@borgmanJeremy Done. The current code in master does not have the overlay issue I reported above / fixes my issue. Thanks!

This is big enough to warrant a new tagged release, is it not?

skewty avatar Feb 10 '21 18:02 skewty

Yeah im looking to release 0.9 soon-ish. I was really pushing to have upload plugins done for 0.9 but its going to juit have to push out I think.

borgmanJeremy avatar Feb 10 '21 18:02 borgmanJeremy

I'd like to suggest a small improvement to overlay "help boxes" positioning. They should position themselves on the "primary" display (in Gnome) (I am assuming KDE has similar), not the leftmost display.

skewty avatar Feb 10 '21 18:02 skewty

I have a similar issue, it seems like a QT HiDPI problem. I’m not sure if it’s the same problem, but the following command worked great for me.

QT_AUTO_SCREEN_SCALE_FACTOR=0 flameshot

I can finally take a screenshot, lol

hnharejin avatar Mar 27 '21 09:03 hnharejin

flameshot 0.9.0-1

image

Still have the issue on Arch Linux, on KDE, with Nvidia driver.

https://user-images.githubusercontent.com/1641362/115972434-9160bb80-a54e-11eb-8a54-7df43a470c9e.mp4

C0rn3j avatar Apr 24 '21 20:04 C0rn3j

I can confirm this issue.

It is only reproducible under 2 conditions:

  1. multiple displays
  2. Global scale factor in KDE's kscreen is > 100%

I dumped environment of flameshot from 2 runs (with 100% and 150% scaling), and this is the diff

[~]$ diff flameshot.envbad.txt flameshot.envok.txt  
4c4
< SESSION_MANAGER=local/****:@/tmp/.ICE-unix/2252667,unix/****:/tmp/.ICE-unix/2252667
---
> SESSION_MANAGER=local/****:@/tmp/.ICE-unix/2249766,unix/****:/tmp/.ICE-unix/2249766
19c19
< QT_SCREEN_SCALE_FACTORS=eDP1=1.5;DP1=1.5;DP2=1.5;HDMI1=1.5;HDMI2=1.5;VIRTUAL1=1.5;
---
> QT_SCREEN_SCALE_FACTORS=eDP1=1;DP1=1;DP2=1;HDMI1=1;HDMI2=1;VIRTUAL1=1;
34c34
< XDG_SESSION_ID=7
---
> XDG_SESSION_ID=5
45c45
< XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session2
---
> XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1

Based on this I made an assumption, that flameshot incorrecty handles the QT_SCREEN_SCALE_FACTORS variables.

Observed case 1

  1. Set global scale to 100%
  2. Log out and Log in
  3. flameshot works ok

Observed case 2

  1. Repeat steps from case 1
  2. Set global scale to 150%
  3. Restart plasma and window manager (kquitapp5 plasmashell && kstart5 plasmashell &) and all the necessary apps to pick up new settings
  4. flameshot works ok

Observed case 3

  1. Repeat steps form case 2
  2. Restart flameshot
  3. flameshot works ok (I'm confused at this point)

Observed case 4

  1. Set global scale to 150%
  2. Log out and Log in
  3. flameshot does not work

Observed case 5

  1. Repeat steps from case 4
  2. Restart flameshot with
export QT_SCREEN_SCALE_FACTORS="eDP1=1;DP1=1;DP2=1;HDMI1=1;HDMI2=1;VIRTUAL1=1;"
flameshot gui
  1. flameshot does not work (I'm confused again)

I hope this helps. If any additional info/experiments are needed, please let me know, I'm willing to help with whatever to make this fixed.

koiuo avatar May 20 '21 08:05 koiuo

I'm affected by this bug too. Hopes it could be fixed.

Starrah avatar Jul 05 '22 09:07 Starrah

This issue still exists in Kubuntu 23.10. I have two monitors, one with the laptop running 2880 x 1800 and another external monitor running 3840 x 2160, both are scaled at 150%. The whole screen displaced to the left when taking screen capture. Any solution?

sctse999 avatar Nov 20 '23 01:11 sctse999

Update:

This has been solved by adding the following parameter to start flameshot

/bin/sh -c 'env QT_SCREEN_SCALE_FACTORS="1" /usr/bin/flameshot gui -p ~/Pictures'

sctse999 avatar Nov 20 '23 02:11 sctse999

Still having this issue. QT_SCREEN_SCALE_FACTORS=1 doesn't help

avindra avatar Mar 11 '24 16:03 avindra

Ah, setting QT_SCALE_FACTOR=1 works for me.

avindra avatar Mar 11 '24 16:03 avindra