* Add grim-based wayland universal screenshot adapter
In the past, flameshot used a special and superfluous method to call the wayland screenshot component
- dbus protocol communication. Although this method is supported by a large number of distributions,
it does not take into account the actual situation of wayland (including WM custom desktop environment users).
Now, we can enable the wayland universal screenshot adapter with the help of grim,
just add the following compilation flags in cmake:
```
-DUSE_WAYLAND_GRIM=true
```
In addition, the patch also adds HYPRLAND type and OTHER type support
* grim outputs to standard streams instead of files
* Automatically enable wayland clipboard support when USE_WAYLAND_GRIM is enabled
* Cancel USE_WAYLAND_GRIM Activate USE_WAYLAND_CLIPBOARD by default
Due to the dependency problem of USE_WAYLAND_CLIPBOARD,
cancel USE_WAYLAND_GRIM to activate USE_WAYLAND_CLIPBOARD by default,
Add a warning prompt to activate USE_WAYLAND_GRIM when USE_WAYLAND_CLIPBOARD is activated
* perform formatting
* modify cmake message
The grim adapter cannot be used in gnome and similar environments, modify the cmake message to express it
* remove generic screenshot adapter for gnome
Generic screenshot adapter is only supported on compositors that support wlroots
* Update format
* Minor refactoring, removed unused headers
* Grab the content from the right window
Fixed bug with black screen - bug was related to capturing
data outside the window
* fixed clangd formatting
* Make --path work correctly with relative paths
Relative paths are taken relative to the working directory of the calling
command, not relative to the daemon's working directory.
* Allow file paths in --path and refactor
* Remove some redundancy
These actions are already performed in the respective functions in
FlameshotDBusAdapter.
* Tweak --path error checker a bit more
* Rework FileNameHandler and update references
The class now has a much simpler interface.
- Screenshot paths are now universally determined by the function
properScreenshotPath
- Some unreferenced methods have been removed
- The documentation of properScreenshotPath documents the changes well.
* Add crude tests for --path
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fix failing build on Windows
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Add a test for invalid path
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Make tests clearer
Thanks to @mmahmoudian for his review and contribution.
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fix bug in properScreenshotPath
Auto-numeration did not work when the screenshot was automatically
saved when copied to clipboard.
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fall back to default pictures location
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Revert "Remove some redundancy"
This was not redundancy. I had actually introduced a bug with this.
This reverts commit 011ef737564892e494518443e6b80ccf3d286ae1.
* Change default path only on interactive save
Previously, the default save path was changed every time a screenshot
was saved. Now, that only happens when it gets saved from the GUI.
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Change --path help text
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Allow other image formats
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
closes: #1374 .
Use SPDX short-form identifiers instead of lengthy copyright
header to document per-file license and copyright.
This commit updates all files under src/ directory where applicable
as well as org.flameshot.Flameshot.metainfo.xml.
The core now has a method requestCapture, which receives a
CaptureRequest object with all the needed information.
This reduces code duplication in future features.
Updated dbus API. Now it sends a signal with every capture, it may
be captureFailed or a captureTaken which contains the raw image
bytes in png format. You have to add an id to the screenshot calls
so it will be returned as a way to know the origin of the signal.
- new imgur upload interface.
- rework for a better code structure. It still needs another change separating the Controller from the code dedicated to export data to the system.
- created the concept of "worker", component used to do some work based on a screenshot.