flameshot-org / flameshot

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

Fails when fractional scaling <> 100% #564

Open fzaninotto opened 5 years ago

fzaninotto commented 5 years ago

Ubuntu 19.04 supports fractional scaling on Wayland and Xorg. When using a factor that is not the default (like 150%, for instance on a HiDPI display), and trying to capture a screenshot with flameshot, the screen flickers an changes resolution. and flameshot can only capture a quadrant of the screen.

dszryan commented 5 years ago

please fix this - affects the core functionality of the product when using a HiDPI screen

flantel commented 4 years ago

Any update on this? Since the demise of Shutter, Flameshot is the best tool, but without fractional scaling it is no good to me.

Mart-Bogdan commented 4 years ago

@fzaninotto @flantel Hello, I tried to make a fix. Can you please test patched version released here as downloadable built archive with x64 executable https://github.com/Mart-Bogdan/flameshot/releases/tag/tmp-fix-scaling

flantel commented 4 years ago

Hi,

No, unfortunately this does not work for me. The screen keeps flipping around between different resolutions. This is on Ubuntu 19,10/Gnome

Mart-Bogdan commented 4 years ago

@flantel you are using 200% scaling? indeed it wasn't working on 2x only on fractional, like 1.5x New patch should work https://github.com/Mart-Bogdan/flameshot/releases/tag/tmp-fix-scaling-2 I've tested it on Gnome too.

flantel commented 4 years ago

Hi @Mart-Bogdan I am using 150% on a Pixelbook, running ubuntu 19.10/Gnome/X

Result is the same - screen will flip between small and normal and continues to do so until I press escape.

adampiskorski commented 4 years ago

Same issue on Pop_OS! on both an Eve V (surface pro look-alike) and a Matebook X Pro, both at 150%.

CumpsD commented 4 years ago

Same here on Pop_OS Surface Laptop 2 at 150% Impossible to take a screenshot, it just toggles constantly big/small/big/small/...

karolbe commented 4 years ago

@Mart-Bogdan Hi Bogdan, can you please confirm if your fix for fractional scaling was indeed incorporated into the main flameshot branch? Occasionally I get flameshot updates from OpenSUSE and it is breaking it, so clearly at least SUSE does not have that patch.

Mart-Bogdan commented 4 years ago

@Mart-Bogdan Hi Bogdan, can you please confirm if your fix for fractional scaling was indeed incorporated into the main flameshot branch? Occasionally I get flameshot updates from OpenSUSE and it is breaking it, so clearly at least SUSE does not have that patch.

Hello, no it wasn't. there were someone who took my changes into their fork.

Likely this form merged it https://github.com/hosiet/flameshot

But I've found that my patch don't work well with dual monitor set-up. And I won't have time to take a look in the coming weeks.

karolbe commented 4 years ago

I have dual monitors (although with the same 4k resolution with fractional scaling) and it works perfectly. OK, I will just keep using your build. Thanks for your work!

Mart-Bogdan commented 4 years ago

If they are at different horizontal level tool buttons are aligned wierdly.

On Mon, Jun 15, 2020, 15:04 Karol Bryd notifications@github.com wrote:

I have dual monitors (although with the same 4k resolution with fractional scaling) and it works perfectly. OK, I will just keep using your build. Thanks for your work!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lupoDharkael/flameshot/issues/564#issuecomment-644087910, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAF5G7XMBKIICEMCS7HW7WLRWYE6TANCNFSM4H2RTW5A .

SergioBurlaka commented 4 years ago

flameshot does not work fine at scale 125% display Ubuntu 20.04 LTS The screen become flashing

zhenglinli commented 4 years ago

same at at scale 125% display Ubuntu 20.04 LTS

yechs commented 4 years ago

Same here on Arch Linux w/ KDE on X11 while using version 0.8.1 Rolling back to version 0.6.0 seems to work for me

bab5470 commented 4 years ago

Ubuntu 20.04.1 LTS here with Dual HiDPI monitors set to 150% fractional scaling.

Running the very latest Flameshot release (0.8.5) when I try to take a screenshot both my monitors flicker on and off and it becomes actually difficult to break out of.

Has there been any progress addressing this issue? Is there a beta or alpha build we could try?

I have tried this: https://github.com/Mart-Bogdan/flameshot/releases/tag/tmp-fix-scaling-2 and it doesn't work for me.

borgmanJeremy commented 4 years ago

I'm actively working on it but it is not an easy issue to solve.

Im at a point where I can confirm the screenshot is actually taken and sized correctly, however it displays with an X offset. I haven't quite figured out why.

borgmanJeremy commented 3 years ago

Ive made some good progress on this. I can correct the offset by adding a move command here: https://github.com/flameshot-org/flameshot/blob/eef2b75bf7d02a6fbfee8c8dbc59eb35afaa4337/src/widgets/capture/capturewidget.cpp#L120

The offset for my current test is 640px. My current set setup is 2x monitors with 1920x1080 resolution and fractional scaling of 1.5.

1920 * 2monitors / 640 = 6. I don't understand why there is this factor of 6, but the fact that its a perfect divisor makes me think I am on the right track.

Edit: Okay great I figured it out....still want to understand WHY the issue occurs, but there is scare documentation on QT fractional scaling. The offset is: resolution of primary display - resolution of primary display* (1/scaling)

Edit: It also seems to only happen when the primary screen is on the left.

Edit: 2020/11/22: Still havent uncovered root cause. My next step is creating a minimal working example to post on the QT forums.

Edit: 2020/11/23: Minimal working example of bug posted here: https://forum.qt.io/topic/121111/position-of-widget-with-fractional-scaling

faedy2 commented 3 years ago

flameshot does not work fine at scale 125% display Ubuntu 20.04 LTS The screen become flashing

I'm not using fractional scaling, but I do have dual-monitors, and Flameshot flashes randomly when I take a screenshot

dgoosens commented 3 years ago

same issue on PopOS 20.10 with 4K screen at 200% scaling captured images are 2x the expected size

I read @borgmanJeremy is making progress....
thanks for that !
hope you'll figure it out soon

dotupNET commented 3 years ago

Ubuntu 20.04.1 LTS here with Dual HiDPI monitors set to 150% fractional scaling.

Running the very latest Flameshot release (0.8.5) when I try to take a screenshot both my monitors flicker on and off and it becomes actually difficult to break out of.

Has there been any progress addressing this issue? Is there a beta or alpha build we could try?

I have tried this: https://github.com/Mart-Bogdan/flameshot/releases/tag/tmp-fix-scaling-2 and it doesn't work for me.

Same behavior with single monitor and 125% scaling

kvz commented 3 years ago

Same for me at at scale 125% on a dell xps13 with the latest ubuntu (groovy) and all updates installed as of today. Flameshot can only capture a portion of my screen. So it's basically guesswork what gets captured, and anything too much right or bottom is out of the question

Calvin-Browne commented 3 years ago

Same issue with me - Ubuntu 20.04.1 LTS. Tried the temp binary above - no go.

I have a 4k monitor (@125%) & a 1080 (@100%) monitor. When launching flameshot, the screen starts 'rolling'.

Back to Shift-PrtScn for now I guess

bitclaw commented 3 years ago

As a workaround, I installed gnome-tweak-tool on Ubuntu 20.04 and instead of using fractional scaling in settings, I increased the Scaling Factor in Fonts in Gnome Tweaks settings. A factor of 1.35 worked ok for me using a dual monitor setup with ASUS Designo 27" WQHD IPS DP HDMI 4K.

image

The only thing is that the dash icons were a bit smaller but you can increase the size in Settings -> Appearance -> Icon size.

mrmodolo commented 3 years ago

Same issue with me - Ubuntu 20.10. Tried the temp binary above, same error.

I have only one 4k monitor (@150%) . When launching flameshot, the screen starts 'flashing'.

MartinHaeusler commented 3 years ago

Ubuntu 20.10 user here, 4k monitor at 125% display scaling. Flameshot can only take screenshots of the upper half of my monitor, which is really annoying. It's a super neat tool otherwise, but unfortunately pretty useless for me at the moment... :/

leonardopn commented 3 years ago

Same problem here. I have two monitors and one of them is in 1.5X scale in the latest version of the XFCE arch.

I really noticed that if I put the primary monitor as the left monitor, the problem happens. If the primary monitor is the one on the right, I can take images of the screen normally.

jeetsrs commented 3 years ago

Same issue as others here - Ubuntu 20.10, 4K hidip monitor, Gnome, running at a fractional scaling factor of 125%.

Flameshot just goes bonkers - screen blanks out for a few seconds, return back, and blanks again. The selection box is limited to 3/4th of the screen.

Please fix this - I loved using Flamshot before but its unusable if one prefers fractional scaling vs the older method of just increasing the text size using GTools

Sapemeg commented 3 years ago

i have exactly the same issue with @jeetsrs

Prashambhuta commented 3 years ago

Same issue as others here - Ubuntu 20.10, 4K hidip monitor, Gnome, running at a fractional scaling factor of 125%.

Flameshot just goes bonkers - screen blanks out for a few seconds, return back, and blanks again. The selection box is limited to 3/4th of the screen.

Please fix this - I loved using Flamshot before but its unusable if one prefers fractional scaling vs the older method of just increasing the text size using GTools

I have similar issues as well

Prashambhuta commented 3 years ago

thanks @bitclaw for the work-around! :)

timlinux commented 3 years ago

Thank you the workaround here works well for me: https://github.com/flameshot-org/flameshot/issues/564#issuecomment-750014960

whaliendev commented 3 years ago

As a workaround, I installed gnome-tweak-tool on Ubuntu 20.04 and instead of using fractional scaling in settings, I increased the Scaling Factor in Fonts in Gnome Tweaks settings. A factor of 1.35 worked ok for me using a dual monitor setup with ASUS Designo 27" WQHD IPS DP HDMI 4K.

image

The only thing is that the dash icons were a bit smaller but you can increase the size in Settings -> Appearance -> Icon size.

Nice try! It works for me on Ubuntu 20.04, Gnome

weiying-robotic commented 3 years ago

I also still have this problem on Ubuntu 20.04 with kernel 5.10. Thanks for the work around mentioned by @bitclaw . But it will impact some other applications in my use case. Is it actual a problem with QT?

oskaremil commented 3 years ago

For KDE users the workaround is located in the Fonts system settings module.

image

thegass commented 3 years ago

same issue on pop_os 21.04 on my 4k screen with 125% scaling. screen flashes wildly between resolutions and either stays then on 200% or only the topleft corner of the screen is selectable. makes this great tool unusable on thist screen.

function2-llx commented 3 years ago

Ive made some good progress on this. I can correct the offset by adding a move command here:

https://github.com/flameshot-org/flameshot/blob/eef2b75bf7d02a6fbfee8c8dbc59eb35afaa4337/src/widgets/capture/capturewidget.cpp#L120

The offset for my current test is 640px. My current set setup is 2x monitors with 1920x1080 resolution and fractional scaling of 1.5.

1920 * 2monitors / 640 = 6. I don't understand why there is this factor of 6, but the fact that its a perfect divisor makes me think I am on the right track.

Edit: Okay great I figured it out....still want to understand WHY the issue occurs, but there is scare documentation on QT fractional scaling. The offset is: resolution of primary display - resolution of primary display* (1/scaling)

Edit: It also seems to only happen when the primary screen is on the left.

Edit: 2020/11/22: Still havent uncovered root cause. My next step is creating a minimal working example to post on the QT forums.

Edit: 2020/11/23: Minimal working example of bug posted here: https://forum.qt.io/topic/121111/position-of-widget-with-fractional-scaling

Is there any progress since then? Wondering we have to use Qt6 to resolve the issue according to this topic on Qt forum.

incredibleSaint commented 3 years ago

My flickers went away, when I set Maximum Refresh Rate for both monitors in Settings (Settings->Displays->Refresh Rate).

Config: Ubuntu 20.04.1, Gnome, Flameshot 0.6.0, FullHd Monitor + 4K Monitor

abhitrueprogrammer commented 3 years ago

Same bug on ubuntu 21.04, flameshot version 0.8.5-4, fractional scaling at 125%. Tried snap v0.10.1+git0.4e406ec, same problem there too.

JuanEL0 commented 3 years ago

I have the same bug on EndeavourOS (2021.08.27 build) using Gnome 40.4 and with fractional scaling 125%

borgmanJeremy commented 3 years ago

Everyone with fractional scaling will have this issue. I've already posted the root cause investigation we simply have not identified a way to fix it.

leandervaneekelen commented 3 years ago

Just want to note that @bitclaw's suggested workaround works quite well for me as a pop_os! 20.04 user on a 4K screen.

wzzyj commented 3 years ago

Enable DPI awareness will fix the issue.

Short story version: Try to start it following command:

env QT_AUTO_SCREEN_SCALE_FACTOR=1 flameshot

If it works. We can "persist" it by adding the env variable to .profile

echo "export QT_AUTO_SCREEN_SCALE_FACTOR=1" >> ~/.profile

Long story version debug (in Chinese): https://blog.willzhou.com/solve-fractional-scaling-issue-for-flameshot/

MacNetron commented 3 years ago

Enable DPI awareness will fix the issue.

Short story version: Try to start it following command:

env QT_AUTO_SCREEN_SCALE_FACTOR=1 flameshot

If it works. We can "persist" it by adding the env variable to .profile

echo "export QT_AUTO_SCREEN_SCALE_FACTOR=1" >> ~/.profile

Long story version debug (in Chinese): https://blog.willzhou.com/solve-fractional-scaling-issue-for-flameshot/

This doesn't work for me, everything still moves around while trying to capture an area. Falling back to Gnome extension Screenshot tool. Although this lacks all the drawing functionality, it is able to capture areas. I'm on PopOS! with a laptop (no fractional scaling) + 2x 4K monitors with fractional scaling.

wzzyj commented 3 years ago

Enable DPI awareness will fix the issue. Short story version: Try to start it following command:

env QT_AUTO_SCREEN_SCALE_FACTOR=1 flameshot

If it works. We can "persist" it by adding the env variable to .profile

echo "export QT_AUTO_SCREEN_SCALE_FACTOR=1" >> ~/.profile

Long story version debug (in Chinese): https://blog.willzhou.com/solve-fractional-scaling-issue-for-flameshot/

This doesn't work for me, everything still moves around while trying to capture an area. Falling back to Gnome extension Screenshot tool. Although this lacks all the drawing functionality, it is able to capture areas. I'm on PopOS! with a laptop (no fractional scaling) + 2x 4K monitors with fractional scaling.

Hmmm..... In my case its 2x 4k monitors (desktop env) with same fractional scaling setting.

In a mixed case maybe consider set QT_SCREEN_SCALE_FACTORS manually

Jdevvv commented 3 years ago

Hi guys, still the same on Ubuntu 20.04 with a fractional scaling of 150%. I'm not fan of putting 100% or 200% and increase font scaling factor with tweaks tool

Any news on this issue ?

borgmanJeremy commented 3 years ago

It's still an upstream issue not expected to be fixed until qt6.

borgmanJeremy commented 3 years ago

Unfortunately I just compiled against Qt6 and this is still an issue, so more investigation is needed.

attiks commented 2 years ago

I'm using the following on Ubuntu 20, primary screen set to 100%, external screen set to 150% scaling

export QT_AUTO_SCREEN_SCALE_FACTOR=0
export QT_SCREEN_SCALE_FACTORS="1;1.5"

works like a charm

derdlok commented 2 years ago

For KDE users the workaround is located in the Fonts system settings module.

image

I actually set scaling to 125% in order to see text a bit larger on my laptop. Changed it back to 100% and increased the dpi to 125, and its pretty much the same and screenshots work perfectly now. Thanks!