Automatically close daemon when it is not needed
Flameshot Version
Flameshot 12.1.0-2build2
Installation Type
Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)
Operating System type and version
Linux Mint 22.1 Xia (X11)
Description
According to this nice Reddit guy,
This option is not working for me as said here. Also, I have set Shift+PrtSc to flameshot gui in my Custom Shortcuts. When I press Shift+PrtSc, Flameshot opens. I take a portion of the space and click copy. It does copy to my clipboard, and it works. However, it still keeps running in the background and puts an icon in my system tray. Why is it so?
Steps to reproduce
No response
Screenshots or screen recordings
No response
System Information
OS: Linux Mint Xia 22.1 Monitor: 1366x768 (HD) @60Hz DE: Cinnamon WM: Mutter (Muffin)
I understand the confusion and why this seems like a bug. However the way clipboards are implemented in Linux (maybe elsewhere), is the program that copied the data to the clipboard hosts the data. So if Flameshot were to immediately quit after you copied to the clipboard, you would be unable to paste it anywhere since the memory would be freed.
We have no way to know when a user no longer needs the item in the clipboard so we can't automatically close the daemon. If the tray icon is what is objectionable you can alter the config to not show a tray icon.
Thanks, that explains it. I still have two questions:
- Just curious, how does the GNOME Screenshot tool handle things? It doesn't seem to run in the background all the time.
- What is the option "Automatically close daemon when it is not needed" actually meant for?
-
I have no idea. GNOME screen shot has a huge advantage over flameshot in that it only needs to work with gnome and nothing else. So they may be using a private GNOME API. Even if it was a public interface we try not to add features unless we think they have a good shot of working across the growing number of other DE's.
-
I personally see no use for the feature because I don't mind the daemon running. But if you wanted the daemon to automatically close after saving to a file, uploading to imgur, or closing all pins it can be useful.
Qt apparently does have a method to see if ownership of the clipboard has moved https://doc.qt.io/qt-6/qclipboard.html#ownsClipboard. Need to confirm if this is available in Qt5 or if this task should wait until we port to Qt6. So it may be possible to:
- check if user enabled autoclose
- start a task that polls this Qt function once every 1-2 seconds
- close flameshot after clipboard ownership has moved
I'm a bit skeptical this will work well across the various wayland implementations, but it's probably worth a try. So I will re-open this as a feature request.
@borgmanJeremy should I create a new milestone for Qt6 and keep track of such issues?
Sure! I think the main blocker is an issue with SingleApplication and MacOS.
Posting that the Qt6 port is completed so this can begin if someone wants to take a stab at it.