Open kekonn opened 1 year ago
I have exactly the same problem. I use Flameshot on Arch and it stopped working after my routine updates.
does it launch or log anything when you do this command on the terminal? flameshot gui
I am on arch too, 6.5.5-arch1-1
it does work on my side, however due to gnome experimental fractional scaling, the window does open in the wrong places and block the places that I am trying to screenshot
I have a feeling that this could be a wayland issue
OK, that's interesting, actually I have stopped using the AUR flameshot-git, I have installed flameshot through official arch repos (they didn't have this before) and it started working without fractional scaling issue or any other issues. There is a warning that you should be solving for consistent usage, please set QT_QPA_PLATFORM=wayland
does it launch or log anything when you do this command on the terminal?
flameshot gui
It does.
I am on arch too,
6.5.5-arch1-1
it does work on my side, however due to gnome experimental fractional scaling, the window does open in the wrong places and block the places that I am trying to screenshotI have a feeling that this could be a wayland issue
OK, that's interesting, actually I have stopped using the AUR flameshot-git, I have installed flameshot through official arch repos (they didn't have this before) and it started working without fractional scaling issue or any other issues. There is a warning that you should be solving for consistent usage, please set
QT_QPA_PLATFORM=wayland
I want to point out that flameshot gui
works from the terminal wether QT_QPA_PLATFORM
is set or not. It's when I use the tray icon or through a gnome shortcut that there is an issue.
I am starting to suspect that something in my Gnome desktop updated and broke an assumption of Flameshot. Is there a way to enable debug logging to get more info about the error Flameshot produces?
can you delete the package that you installed from AUR and install the official one? (extra/flameshot)
I did not install through the AUR:
Thanks for the issue and also thank you @mrwormhole for the comments. I think I should mention few points:
flameshot-git
is actually maintained by us. Therefore it is "official", but it is always compiling aganst the HEAD of the master branch of this git repo, therefore you should consider it as beta, and not stable release.flameshot gui
to cause segfault. We are aware of it and it is getting worked on.I am not a Gnome user, so I cannot right-away confirm this. I will try to reproduce the issue in a VM later and see if it is reproducible in a clean-install VM. in the meantime, perhaps you can use the AppImage while we are investigating :)
Is there anything I can do to help, such as gather debug logs? I tried to look in the settings, but couldn't find anything about debug logging.
@kekonn Thanks, but unfortunately we do not have extensive log reporting. Flameshot was very stable until Gnome Wayland hit the market and then many things went wrong and we are having hard time to keep up. The best help you can do is to install Arch + Gnome Wayland on a VM (no other software), and then install Flameshot and see if flameshot gui
works there or not. I personally don't have access to a computer with enough empty disk space to try to reproduce this.
Also, please edit your original post and change the Installation type to Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)
because you have installed Flameshot from the extra
repo of Arch rather than AUR.
Also, please edit your original post and change the Installation type to
Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)
because you have installed Flameshot from theextra
repo of Arch rather than AUR.
Done! I also want to mention that running flameshot gui
from the terminal does work for me. The issue is that that is the only way to make it work.
The Gnome shortcut and tray icon method are the ones that broke sometime in the last week. I will also try to see if the appimage improves the situation.
EDIT: The AppImage throws the following error and does not work at all:
~/Applications
❯ ./Flameshot-12.1.0.x86_64_10ab227368a704f2d66cded7a7aa8248.AppImage
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
execv error: No such file or directory
Same as @kekonn, it works for me from the terminal. Using a shortcut from Gnome, I see in the system logs:
oct 09 10:26:55 t14 flameshot[2895]: Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
oct 09 10:26:55 t14 systemd[1272]: Started Application launched by gsd-media-keys.
oct 09 10:26:55 t14 xdg-desktop-por[1889]: Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Only the focused app is allowed to show a system access dialog
oct 09 10:26:55 t14 flameshot[2895]: flameshot: error: Unable to capture screen
oct 09 10:26:55 t14 flameshot[2895]: flameshot: error: Unable to capture screen
oct 09 10:26:55 t14 flameshot[2895]: flameshot: info: Screenshot aborted.
Worth to mention that Flameshot was working just fine as of version 12.0.1-2
and stopped working in 12.0.1-3
.
Same here. Launching via terminal works as expected (I only have a warning but I don't know if he did it before)
flameshot gui
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Using Gnome shortcuts (PRINT with /usr/bin/flameshot gui) gives me "Unable to capture screen"
Flameshot v12.1.0 (001726a5)
Compiled with Qt 5.15.5
OS: EndeavourOS
Kernel: x86_64 Linux 6.5.5-arch1-1
DE: GNOME 44.4
WM: Mutter
Same issue came to me after upgrading my manjaro(gnome DE) today, only terminal command or right click on tray icon worked!
@qomosoloto
only terminal command or right click on tray icon worked!
Then what doesn't work? These two are the only two ways you can trigger Flameshot.
For me only the terminal method works, but the method that stopped working for all of us is triggering it through Gnome Shortcuts.
Reproduced on latest Arch with GNOME.
flameshot gui
from gnome-terminal
works fine, but the exact same command doesn't work from the launcher (i.e. Alt+F2
).
Ah wait, I should've installed the AUR version, previous comment is for flameshot
from the official extra
repo.
I'll test with the AUR version when I get the chance.
Same problem with flameshot-git
from AUR.
after some testing I found: https://github.com/flatpak/xdg-desktop-portal/issues/1070
I quick workaround is: copy your /usr/share/applications/org.flameshot.Flameshot.desktop
file to ~/.local/share/applications/flameshot.desktop
. xdg-desktop-portal is than able to properly find the application and asks for permissions and/or allows the screenshot. You can delete the new desktop file right after you granted permissions.
Alternatively a downgrade of the xdg-desktop-portal binary might also work.
@mmahmoudian From that issue, this summary comment seems relevant to you/flameshot: https://github.com/flatpak/xdg-desktop-portal/issues/1070
specifically:
And lastly, the error message you're seeing is on purpose. Flameshot needs to create a window before using the portal. You should also open an issue on their bug tracker.
I quick workaround is: copy your
/usr/share/applications/org.flameshot.Flameshot.desktop
file to~/.local/share/applications/flameshot.desktop
.
For me this doesn't help, also tried on the new user.
We can debug some via xdg-desktop-portal --replace --verbose
In XDP 1.6.0 it was indeed its bug which allowed flameshot to run to permission request and so forth:
XDP: Assigning app ID "" to pid 55633 which has unit "app-gnome-flameshot-55633.scope"
XDP: Handle Screenshot
XDP: No 'screenshot' permissions found: No entry for screenshot
XDP: Calling Screenshot with interactive=0
XDP: sending response: 0
The ID is empty because of XDP bug, it says 'no permission found' though request was shown and I allowed it and all good.
Since XDP 1.7.0 the matching bug was fixed, now it's able to match the ID, but the permission request isn't called:
XDP: Assigning app ID "flameshot" to pid 64571 which has unit "app-gnome-flameshot-64571.scope"
XDP: Handle Screenshot
XDP: No permissions stored for: screenshot screenshot, app flameshot
(/usr/lib/xdg-desktop-portal:64541): xdg-desktop-portal-WARNING **: 02:03:49.117: Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Only the focused app is allowed to show a system access dialog
XDP: sending response: 2
So just by guessing based on the output the probable solution would be to create some small window on flameshot gui
?
yeah I just repeated it on a different system. You actually have to start the application and take a screenshot while the configuration window is focused. It should then ask for permissions.
@qomosoloto
only terminal command or right click on tray icon worked!
Then what doesn't work? These two are the only two ways you can trigger Flameshot.
You can also trigger flameshot by using a custom keyboard shortcut to activate that terminal command, i.e. setting flameshot gui
to activate when you press the Print Screen
key or a key combination like Ctrl + Print Screen
. The problem that multiple people (including me) are having is that we are not able to trigger Flameshot using a keyboard shortcut set via GNOME settings.
I have exactly the same problem.but in terminal is ok.
yeah I just repeated it on a different system. You actually have to start the application and take a screenshot while the configuration window is focused. It should then ask for permissions.
This works for me, but only when taking screenshots via the tray icon. So to recap:
flameshot gui
from the terminal: worksTake Screenshot
from the tray icon: works if running the workaround above (copy the desktop file, open flameshot configuration from the tray icon, take screenshot from the tray icon with the configuration open, grant permission)flameshot gui
: does not work@gianmarcotoso
flameshot gui
from the terminal: works- ...
- Shortcut mapped to
flameshot gui
: does not work
This is weird. Isn't the Gnome shortcut suppose to start a shell and run the command (in this case flameshot gui
) there?
What happens if you change the Gnome shortcut to bash -c "flameshot gui"
and see if that changes anything?
@mmahmoudian it's extremely weird.
Isn't the Gnome shortcut suppose to start a shell and run the command (in this case flameshot gui) there? What happens if you change the Gnome shortcut to bash -c "flameshot gui" and see if that changes anything?
I had the same intuition and actually tried that, same result: "Unable to capture screen". I've also tried to modify the flameshot.desktop
file, setting the launch command to flameshot gui
, and then mapping the shortcut to gtk-launch flameshot.desktop
: same result.
I suspect it has something to do with how Gnome handles permission, but I can't really be sure as I can't find any logs anywhere. Do you have any suggestion as to how this can be debugged?
Worth to mention that Flameshot was working just fine as of version
12.0.1-2
and stopped working in12.0.1-3
.
Unrelated, tried downgrading just for the sake of it.
What happens if you change the Gnome shortcut to
bash -c "flameshot gui"
and see if that changes anything?
unfortunately does not work for me
Using argos script on Gnome as a workaround:
filename: ~/.config/argos/flameshot.sh
#!/usr/bin/env bash
echo "flameshot"
echo "---"
echo "take screenshot | bash='flameshot gui' terminal=false"
This creates a shortcut for flameshot on Gnome's top bar. Invoking flameshot from this shortcut works normally
using wrapper like /usr/local/bin/flameshot-gui allows to use as shortcut:
#!/bin/bash
/usr/bin/flameshot gui
But paste after screenshoting doesn't work.
thank you for the wrapper idea, made it work via https://extensions.gnome.org/extension/5874/launcher/
I am experiencing the same problem. I have noticed that I can run flameshot using Gnome Console (kgx), but I can't with Kitty or the shortcut.
Arch, Gnome 45, kernel 6.1.56-1-lts.
I'm using Arch with the extra/flameshot
package on Gnome. Here's the output of QT_DEBUG_PLUGINS=1 flameshot gui
for me:
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqeglfs.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqeglfs.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"eglfs"
]
},
"archreq": 0,
"className": "QEglFSIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("eglfs")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqlinuxfb.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqlinuxfb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"linuxfb"
]
},
"archreq": 0,
"className": "QLinuxFbIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("linuxfb")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqminimal.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqminimal.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"minimal"
]
},
"archreq": 0,
"className": "QMinimalIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqminimalegl.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqminimalegl.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"minimalegl"
]
},
"archreq": 0,
"className": "QMinimalEglIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("minimalegl")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqoffscreen.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqoffscreen.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"offscreen"
]
},
"archreq": 0,
"className": "QOffscreenIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqvnc.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqvnc.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"vnc"
]
},
"archreq": 0,
"className": "QVncIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqwayland-egl.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqwayland-egl.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"wayland-egl"
]
},
"archreq": 0,
"className": "QWaylandEglPlatformIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("wayland-egl")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqwayland-generic.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqwayland-generic.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"wayland"
]
},
"archreq": 0,
"className": "QWaylandIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("wayland")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqwayland-xcomposite-egl.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqwayland-xcomposite-egl.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"wayland-xcomposite-egl"
]
},
"archreq": 0,
"className": "QWaylandXCompositeEglPlatformIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("wayland-xcomposite-egl")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqwayland-xcomposite-glx.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqwayland-xcomposite-glx.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"wayland-xcomposite-glx"
]
},
"archreq": 0,
"className": "QWaylandXCompositeGlxPlatformIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("wayland-xcomposite-glx")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqxcb.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqxcb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"xcb"
]
},
"archreq": 0,
"className": "QXcbIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
loaded library "/usr/lib/qt/plugins/platforms/libqxcb.so"
Authorization required, but no authorization protocol specified
qt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Hopefully this helps :sweat_smile:
Yes. I confirm. Bug after the last update. Launching via the terminal works. Manjaro. Through the gnome shortcut does not work.
Same problem on Arch Linux, Gnome 45, Wayland.
Workaround
Replace
flameshot gui
with
gnome-terminal -- bash -c 'flameshot gui' &
if you already use the new gnome console:
kgx -e 'flameshot gui'
Me too.. Same problem on Arch Linux - Gnome 45 - Wayland.
Same here, Arch Linux, Gnome 45, Wayland
Maybe the problem with Flameshot is some consequence of a problem with GNOME, since I also have a problem with prints with the Ksnip tool.
@qomosoloto
only terminal command or right click on tray icon worked!
Then what doesn't work? These two are the only two ways you can trigger Flameshot.
There is an app called flypie which you can configure to run custom commands, but when flameshot is ran through it, it fails
Just for the record, this looks pike the duplicate of #3326 but I'll keep it open because of good discussions
I had the same problem. Ubuntu 23.10, Gnome, Wayland. I could use flameshot when started from the terminal (flameshot gui
) and also when taking screenshot from the tray icon. But couldn't use it from a keyboard shortcut.
Found a working solution here: https://github.com/flatpak/xdg-desktop-portal/issues/1070#issuecomment-1771302632
FYI I have tested my previously mentioned workaround on 4 different arch systems, all successful.
using wrapper like /usr/local/bin/flameshot-gui allows to use as shortcut:
#!/bin/bash /usr/bin/flameshot gui
But paste after screenshoting doesn't work.
This worked like a charm; I already have a folder dedicated to all my "hacks," so another script wasn't a big deal. On Fedora 39, at least, to get the copy and paste to work, I added a "&" at the end of the command, which worked as expected.
Same here, Manjaro, Gnome 45, Wayland
I have tried all the solutions above, but none of them worked
(gnome-terminal -- bash -c 'flameshot gui' &
words ok, but there is always an annoying window popping up when I take screenshots. ).
I believe this is a permission issue with xdg-desktop-portal, but I am not familiar with it. I work this out with an ugly solution.
run this python script in backgroup
import os
import pyinotify
class event_handler(pyinotify.ProcessEvent):
def process_IN_OPEN(self, event):
os.system("flameshot gui")
wm = pyinotify.WatchManager()
wm.add_watch("/tmp/flameshot", pyinotify.ALL_EVENTS)
handler = event_handler()
notifier = pyinotify.Notifier(wm, handler)
notifier.loop()
then add touch /tmp/flameshot
to shortcut.
It works fine.
I have the same issue, using @darkblaze69 solution worked nicely. Copy paste into e.g. an e-mail worked as expected.
Try the solution proposed here for Gnome shortcus:
https://github.com/flameshot-org/flameshot/issues/3326#issuecomment-1789267986
If this helps any, i just realized that my Ubuntu 23.10 version is running Wayland by default.
using wrapper like /usr/local/bin/flameshot-gui allows to use as shortcut:
#!/bin/bash /usr/bin/flameshot gui
But paste after screenshoting doesn't work.
This worked like a charm; I already have a folder dedicated to all my "hacks," so another script wasn't a big deal. On Fedora 39, at least, to get the copy and paste to work, I added a "&" at the end of the command, which worked as expected.
The wrapper script also works on Arch Linux Gnome 45 / Wayland.
@flameshot-devs : Have you come closer to a possible solution to fix this issue? A workaround is alright, but not a permanent solution.
Flameshot Version
Flameshot v12.1.0 (-) Compiled with Qt 5.15.10
Installation Type
Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)
Operating System type and version
Arch with kernel 6.5.4-273-tkg-bore
Description
When using a shortcut (Print screen) to run Flameshot I get "Unable to capture screen".
When I run the command from the shortcut in a terminal, it works.
Now both used to work fine before, but stopped working after my daily updates sometime this week. The normal Gnome screenshot program still works.
If you can tell me where I should look for further logs, please do, so I can upload them.
Steps to reproduce
In Arch running Gnome:
/usr/bin/flameshot gui
Screenshots or screen recordings
(Shortcut settings)
System Information