Flameshot: Flameshot does not handle 4K well

Created on 1 Jul 2018  Â·  30Comments  Â·  Source: flameshot-org/flameshot

Describe the bug

Whenever I try to take a screenshot with Flameshot, it only shows a quarter of the screen. More specific, the top left quarter of the screen.
screenshot from 2018-07-01 11-14-48

To Reproduce

  • Open Flameshot
  • Click 'Take Screenshot' from the tray icon

Expected behavior

I should be able to take a screenshot of the full screen.

Desktop (please complete the following information):

  • Model: Dell XPS 15 9560
  • OS: Manjaro Linux (Gnome Edition)
  • Integrated Intel Graphics are used (i7 7700HQ)
  • 4K display
  • Wayland enabled
  • Flameshot version: Flameshot v0.5.1-90-gc75c9aa (Compiled with QT 5.11.0)
Bug Help Wanted

Most helpful comment

anyway in your case you could create wrapper script I belive:

mv /usr/bin/flameshot /usr/bin/flameshot-real
cat <<EOF >/usr/bin/flameshot
#!/bin/sh
unset QT_DEVICE_PIXEL_RATIO 
exec flameshot-real "$@"
EOF
chmod 777 /usr/bin/flameshot

A dirty workaround, but It's hard without active maintainer :(

All 30 comments

Workaround that Works For Meâ„¢:

unset the environment variables QT_SCREEN_SCALE_FACTORS and QT_SCALE_FACTOR, and set QT_AUTO_SCREEN_SCALE_FACTOR to 0 before launching flameshot.
It may also help to unset GDK_SCALE, GDK_DPI_SCALE, and/or ELM_SCALE.

Sadly, that did not change anything for me. Maybe the Wayland session has something to do with it too.

I have same problem in KDE on X.

I have the same problem.
MS Surface Pro 3
4k display / scaling
KDE NEON Developer

Workaround that Works For Meâ„¢:

unset the environment variables QT_SCREEN_SCALE_FACTORS and QT_SCALE_FACTOR, and set QT_AUTO_SCREEN_SCALE_FACTOR to 0 before launching flameshot.
It may also help to unset GDK_SCALE, GDK_DPI_SCALE, and/or ELM_SCALE.

How do I implement this? Is there a way to put this in the .desktop file? If so, how?

I had this same problem, dual 4k displays on KDE in Ubuntu 18.04. Things wouldn't just look weird tho, the screen would get all super glitchy, like it "lost sync" or something. I would have to switch to another VT and kill the flameshot process to be able to see my desktop.

Right now I just have it wrapped in a simple shell script and that's how I start it.

I had this same problem, dual 4k displays on KDE in Ubuntu 18.04. Things wouldn't just look weird tho, the screen would get all super glitchy, like it "lost sync" or something. I would have to switch to another VT and kill the flameshot process to be able to see my desktop.

Right now I just have it wrapped in a simple shell script and that's how I start it.

I have 3 4k monitors running on KDE Plasma and this also did the trick for me. For those that come across this, you can do something like this in a script:

#!/bin/bash
QT_SCREEN_SCALE_FACTORS='' /usr/bin/flameshot &

MS Surface Pro 4 + Dell 4K P2415q
Manjaro 18.0.4+ KDE
The same problem, making scale by change system display settings.

Same here.

Model: Dell XPS 15 9560
OS: Ubuntu 19.04
4K display

Launching Flameshot with QT_SCREEN_SCALE_FACTORS works

QT_SCREEN_SCALE_FACTORS='' /usr/bin/flameshot &

The issue has been resolved for me.
Thank you for an awesome app and for the bug fix.

I still have this problem when using a docking station (laptop connected to 4k display)
2019-09-04_10-12

tried starting flameshot via command line; with suggestions posted here; did not work for me.

QT_SCREEN_SCALE_FACTORS='' QT_SCALE_FACTOR='' QT_AUTO_SCREEN_SCALE=0 GDK_SCALE='' GDK_DPI_SCALE='' ELM_SCALE='' /usr/bin/flameshot gui &

I still have this problem when using a docking station (laptop connected to 4k display)
2019-09-04_10-12

tried starting flameshot via command line; with suggestions posted here; did not work for me.

QT_SCREEN_SCALE_FACTORS='' QT_SCALE_FACTOR='' QT_AUTO_SCREEN_SCALE=0 GDK_SCALE='' GDK_DPI_SCALE='' ELM_SCALE='' /usr/bin/flameshot gui &

You need to run flameshot with this and not flameshot gui. Then it should work

Thanks, tried it. but still does not work for me;

QT_SCREEN_SCALE_FACTORS='' QT_SCALE_FACTOR='' QT_AUTO_SCREEN_SCALE=0 GDK_SCALE='' GDK_DPI_SCALE='' ELM_SCALE='' /usr/bin/flameshot &

image

This is what I use to take screenshots on my 4k laptop. When docked, I have an external 4k display as well.

image

(EDIT: because posted with wrong github account)

Thanks for helping; Using this script is also not working for me. I think my use case is a bit different: my laptop is HD (1920x1080) and is connected to a dock that connects to a 4k display. I am also on Fedora 30.

image

Weirdly enough I changed from Wayland to Xorg and it is fixed for me :)

Seems launching Flameshot from the desktop entry doesn't source environment variables exported from .bashrc, .zshrc, etc..

If I launch Flameshot from my terminal using the flameshot command, and check the process' environment variables (cat /proc/$(pidof flameshot)/environ | tr \\0 \\n), QT_AUTO_SCREEN_SCALE_FACTOR=0 which is correct in my case, as I have that variable exported in my .zshrc.

However launching Flameshot from the desktop entry appears to not source my .zshrc and defaults QT_AUTO_SCREEN_SCALE_FACTOR=2.

To resolve this I did the following:

cp /usr/share/applications/flameshot.desktop ~/.local/share/applications
vim ~/.local/share/applications/flameshot.desktop

Replace Exec=flameshot with Exec=env QT_AUTO_SCREEN_SCALE_FACTOR=0 flameshot under the [Desktop Entry] heading, then restart Flameshot from desktop entry.

Depending on your window manager/desktop environment you may need to play with the other environment variables mentioned in the previous comments. In my case I just had to force the one variable.

Hope this helps someone! :beers:

Hello, friends. I've made attempt to fix this, my pre-release are here
https://github.com/Mart-Bogdan/flameshot/releases/tag/tmp-fix-scaling-2

Feedback welcome.
If it works for you feel free to upwote my Pull Request #678

But I have no ability to test it in Wayland, only on X

The fixes with environment variables mentioned above did not work for me, however after investigating the QT environment variables the following appeared to have caused the issue QT_DEVICE_PIXEL_RATIO. Unsetting it before launching flameshot resolved the issue for me.

Cinnamon 3.4.6 on Linux Mint 18.2

@Alberts00 does it draw icons correctly, etc?
Could you try my FIX? I really would like the authors to merge it.

I believe setting QT_DEVICE_PIXEL_RATIO to 1 would make buttons ridiculously small.

@Mart-Bogdan, unsetting the variable ensures that it is drawn correctly, however since I'm on one screen - 1920x1080 14''' the fact that scaling is not taking place is not really noticable. Before doing the fix mentioned above I did also try your PR.

The results are as follows:

  • master (91ba28c) - with QT_DEVICE_PIXEL_RATIO=auto - 1/4 of the scrren is grayed out
    master_nounset
  • master (91ba28c) - with QT_DEVICE_PIXEL_RATIO unset
    master_unset

  • Mart-Bogdan/tmp-fix-scaling-2 (c3d0377 - #678) - with QT_DEVICE_PIXEL_RATIO=auto - 1/4 of the screen is not covered by flameshot
    matt_fix2_unset

  • Mart-Bogdan/tmp-fix-scaling-2 (c3d0377 - #678) - with QT_DEVICE_PIXEL_RATIO unset
    matt_fix2_set

It seems that at least in my case your fix does not resolve the issue of only 1/4 screen of being covered.

Strange thing.

Just gogoled for Qt documentation and it says

In Qt 5.4, there was an experimental implementation of high DPI scaling introduced via the QT_DEVICE_PIXEL_RATIO environment variable, that you could set to a numerical scale factor or auto. This variable was deprecated in Qt 5.6.

that QT_DEVICE_PIXEL_RATIO is deprecated in Qt.

Never thought that HighDPI support is so hard. Unfortunately, I'm not much fammiliar with QT.

Seems Cinamon handles scaling differently than Plasma.

AS I can see on your first example original image was cropped.

anyway in your case you could create wrapper script I belive:

mv /usr/bin/flameshot /usr/bin/flameshot-real
cat <<EOF >/usr/bin/flameshot
#!/bin/sh
unset QT_DEVICE_PIXEL_RATIO 
exec flameshot-real "$@"
EOF
chmod 777 /usr/bin/flameshot

A dirty workaround, but It's hard without active maintainer :(

Is there any updates on this issue? QT_SCALE_FACTOR doesn't really solve it...

Did you read the comment right above yours? @styfrombrest

no workarounds mentioned in this issue work unfortunately if you have a mixed configuration (f.e. HiDPI notebook display + external full hd monitor).

@andersfylling yes of course, but it doesn't work for me(HiDPI monitor + full hd laptop) that's why I asked. Really liked this app, but looks like I need to find another that will work on my configuration.

I set export QT_AUTO_SCREEN_SCALE_FACTOR=1 on .xprofile.

and use this script

#!/bin/bash
sleep 3s
QT_SCREEN_SCALE_FACTORS=1 /usr/bin/flameshot &

make it auto start.

I use desktop file /home/username/.config/autostart

[Desktop Entry]
Type=Application
Name=Flame
Exec=/home/username/.config/autostart/flameshot.sh

Model: Dell XPS 15 9570
OS: Manjaro Linux (Gnome Edition)
4K display
xorg

I set export QT_AUTO_SCREEN_SCALE_FACTOR=1 on .xprofile.

and use this script

#!/bin/bash
sleep 3s
QT_SCREEN_SCALE_FACTORS=1 /usr/bin/flameshot &

make it auto start.

I use desktop file /home/username/.config/autostart

[Desktop Entry]
Type=Application
Name=Flame
Exec=/home/username/.config/autostart/flameshot.sh
Was this page helpful?
0 / 5 - 0 ratings