-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad behavior on wayland with fractional scaling #748
Comments
I managed to trace back the bug source and wanted to report back. As fractional scaling (1.25) is enabled, my screen (2560x1440) is seen by Qt at its scaled resolution (2048x1152). When I ask to "Take Screenshot", the ScreenGrabber calls Gnome via dbus to save a screenshot of the entire desktop into a temporary file which is saved at screen physical resolution (2560x1440). Then the surface is loaded from filesystem and returned back as a Qpixmap to the CaptureWidget constructor and stored in m_context.origScreenshot and m_context.screenshot. When it's the time to show the image on screen, Qt displays an unscaled 2560x1440 surface on a virtually 2040x1152 screen and this leads to the cropping I was complaining about. Now, I've tried to work this around by scaling the surface m_context.screenshot in the constructor via the scaled(W,H,...) method where (W,H) are retrieved from Qt information on screen geometry. This works but the resulting image is obviously far from sharp because of the scaling process. I've also noticed that copying to the clipboard is broken on wayland, I only get garbage when pasting onto another client. But I'll open another issue for this. |
This issue still exists in 0.8.0. |
This may be fixed from: e1214e2 |
This actually good news because I also have a 27in non hidpi monitor so I should be able to recreate it. Thanks for reporting back |
@duvh93 Thanks for your detailed report. I can confirm your analysis is spot on as to what the issue is. This is an article Qt has which is pretty relevant explaining the difference between "Device Pixels" and "Device Independent Pixels". As a first fix I think downsampling the raw image by the scaling factor would work okay. I know this would throw some pixels away, but is this really noticeable on an annotated screenshot? A better fix would be to have QT draw the widget using device pixels instead of device independent pixels, but so far I haven't found a place in QT do do that. Edit: Actually simply resizing the pixmap will not work. The entire widget needs scaled. This is obvious when you see that the help text and side bar are also cropped. hrmmmmm |
Final comment for the night, this is not actually a wayland issue but a general issue with fractional scaling. Now that KDE supports fractional scaling on X, I can create the same issue on X. |
It's happening to me at 125%, but when I use it, my display resolution switches to something lower and flips back to normal for a short period of time. Keeps looping while in Flameshot. I use Wayland |
I'm having what I think is the same issue, using wayland. My laptop screen is 200% scaling and I have an external monitor at 100%. When I try to use flameshot I get an extremely "zoomed in" section of the screens so I can't use it 😞 |
I also have a similar issue. Wayland with 1.25 fractional scaling. When starting flameshot gui to take a screenshot, my screen zooms in so the bottom part and the right part of the screen is "outside" of the monitor. |
Same issue here with fractional scaling on 4K display - unusable. |
Just came by to report I have the same issue using Ubuntu 21.04 on a laptop with fractional scaling. |
Any update? |
@duvh93 this is not yet fully resolved, but people have suggested some workarounds that have solved the issue. Perhaps the best description can be found here: |
@mmahmoudian it seems that the workarounds only work for KDE, am I correct in that assumption? I tried the one you linked to on Gnome 42 and it doesn't seem to solve it. Is there another workaround for Gnome? |
@rayzorben Fractional scaling on multi-monitor setup are still an issue (if that is the issue you are facing). but Gnome >=41 people typically forget to install |
@mmahmoudian I installed |
Exactly the same issue with me :( |
Finally fixed by change flameshot shortcut from: |
Still it doesn't work for me 😞 |
For Asahi Fedora Remix users: I faced the same issue and But there is no problem when I use Flameshot in Asahi Arch (without any env var prefix with Solution: So I copy the binary compiled from Asahi Arch and place it to Asahi Fedora Remix to resolve that. TODO: I will try on installing it from Fedora Remix with pacman to see if it works. |
Same problem on Fedora 39 with Gnome/Wayland. None of the work arounds listed above work for me. |
Same issue on Fedora 39 with GNOME 45.2 on Wayland. When executing Flameshot from a keyboard shortcut or a tray icon, Flameshot issues "Cannot capture screen" error. When running via terminal (and laptop display is set at 150% scale), 'flameshot gui' produces a cropped version of the screen. I disabled fractional scaling (set laptop display back to 100%), and the issue disappears. The only way to get it to work with a shortcut is to create a script that just runs 'flameshot gui', and then calling that script with a shortcut. |
If
Worked for me on archlinux & sway |
Still having this issue and none of the (seemingly unrelated fixes) works. The comment #748 (comment) seems to describe properly the bug, yet, all that I'm reading everywhere is to try to play with the environment variables. It seems ppl that says that it works are talking about a completely unrelated issue. The resulting screen grabbed is a zoomed in copy of the screen, zoomed in by the factor of the fractional scaling configured. |
I am with you @mikegleasonjr - I have tried EVERYTHING ON this thread with environment variables, and nothing works. I am on a simple use case - Gnome 46, Wayland, Fractional Scaling, Single Monitor. Nothing I have tried works. |
That is my setup as well! |
I just setup a fresh install of running Plasma 6.1 on a 1440p monitor. |
I am having the same problem as @mikegleasonjr. I am using the flatpak version on Pop!_OS. Without the suggested environment variables the screens flicker, constantly changing between resolutions, the whole desktop is useless until I hit escape. With the environment variables set I am able to take screenshots, however on my 4k monitor, which uses 125% fractional scaling, it only lets me take a rectangle snip of a cropped portion of the screen. I'd really love for this to be resolved because Flameshot is exactly what I want in a screenshot utility. |
Flameshot version
Flameshot v0.6.0
Compiled with Qt 5.14.1
Describe the bug
I take a screenshot from terminal with "flameshot gui" and the resulting file is a zoomed blurred version of what I actually see on my screen.
To Reproduce
Use an HiDPI screen, set wayland to fractional scaling value (e.g. 125%), use qt5-wayland and export the env var QT_QPA_PLATFORM=wayland, take a screenshot with flameshot gui
Expected behavior
What I get should be what I see
What I am getting
What I can see (and get with gnome screenshot binding)
The text was updated successfully, but these errors were encountered: