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

Flameshot does not handle 4K well #265

Open GXGOW opened 6 years ago

GXGOW commented 6 years ago

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

Expected behavior

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

Desktop (please complete the following information):

SwooshyCueb commented 6 years ago

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.

GXGOW commented 6 years ago

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

birdkiwi commented 5 years ago

I have same problem in KDE on X.

hoshi411 commented 5 years ago

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

hoshi411 commented 5 years ago

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?

dkowis commented 5 years ago

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.

linuxkd commented 5 years ago

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 &
wilkice commented 5 years ago

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

stjernstrom commented 5 years ago

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 &

hoshi411 commented 5 years ago

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

maxvisser commented 5 years ago

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 &
ghostface commented 5 years ago

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

maxvisser commented 5 years ago

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

dkowis commented 5 years ago

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)

maxvisser commented 5 years ago

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

maxvisser commented 5 years ago

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

mark-rodgers commented 4 years ago

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:

Mart-Bogdan commented 4 years ago

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

Mart-Bogdan commented 4 years ago

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

alberts-s commented 4 years ago

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

Mart-Bogdan commented 4 years ago

@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.

alberts-s commented 4 years ago

@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:

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

Mart-Bogdan commented 4 years ago

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.

Mart-Bogdan commented 4 years ago

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 :(

styfrombrest commented 4 years ago

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

andersfylling commented 4 years ago

Did you read the comment right above yours? @styfrombrest

heldchen commented 4 years ago

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

styfrombrest commented 4 years ago

@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.

ZTFtrue commented 4 years ago

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
ZTFtrue commented 4 years ago

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
elysium306 commented 3 years ago

Hello,

This message is from [June, 2021 AD]

I am still experiencing the same issue. is it something our respectful and mighty Ubuntu developers cannot just hardcode the newer releases by default??

If we were gonna stay at the 1920x1080 resolution forever, I would understand; BUT monitor's quality is only getting better. I am sure they probably have 4K monitors as well.

1) I cannot seem to find the workaround 2) I sincerely hope some Ubuntu developer sees this message one day, and decided to add that feature directly to the system settings when one day we upgraded to the next release.

in the mean time, if someone has a solution, please share here.

I am using latest Ubuntu 21.04 (I usually upgrade to the latest version when they push it from the server side, so by the time when you see this, please check what's the current version of Ubuntu is, and if this has been added to the system config by default; otherwise me and at least hundreds of me may be looking for a solution in the ocean of internet.

Best Regards

Elysium

tcstory commented 3 years ago

met the same problme on manjaro gnome 40 wayland.

Flameshot v0.9.0 Compiled with Qt 5.15.2

NanOns commented 3 years ago

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

nice,it's useful in manjaro KDE,tks 😄

mmahmoudian commented 3 years ago

@NanOns Do you confirm that the form @Mart-Bogdan has actually works on KDE with 4K display? If so, please put a comment on #678

NanOns commented 3 years ago

@NanOns Do you confirm that the form @Mart-Bogdan has actually works on KDE with 4K display? If so, please put a comment on #678

Already commented,but my montior is 3000x2000 and 1920x1080

nivalderramas commented 3 years ago

Is there any update in this issue?

meotimdihia commented 2 years ago

This problem happens on Mac as well.

Bailey-24 commented 1 year ago

Then what tools do you want to use except flameshot In ubuntu20