Commit Graph

50 Commits

Author SHA1 Message Date
lhz07
5b7d41c7e6 Improve the speed of calling grim (#3859) 2025-04-27 09:16:15 -05:00
Monirzadeh
ccb5a27b13 config option to disable grim warrning (#3456)
* add config to disable grim warrning close #3186

* fix typo

* fix format with clang-format
2024-07-02 15:49:11 +03:00
JACK
3ededae574 Add grim-based wayland universal screenshot adapter (#3018)
* 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
2023-02-15 22:44:58 +01:00
Haris Gušić
c4d4fc1590 Fix clang formatting 2023-01-22 18:42:05 +01:00
danillucky1234
84f62b8af7 Fixed issue with black screen when use 'screen' argument (#3035)
* 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
2023-01-22 18:39:59 +01:00
3nprob
5f67ab50fb Recognize Qtile WM (#2854) 2022-10-02 08:20:18 -05:00
greenfoo
2582f063cc Suggest setting XDG_CURRENT_DESKTOP if DE cannot be detected (#2634) 2022-05-31 09:58:39 -05:00
greenfoo
3cd2deca58 Make KDE use Freedesktop portal (#2495) 2022-04-04 19:34:12 -05:00
borgmanJeremy
179f658cd8 Fixing issue with unicode chars in XDG_PICTURE location (#2222)
* Fixing issue with unicode chars in XDG_PICTURE location

* cleaned up
2022-01-03 14:32:38 -06:00
Haris Gušić
36b3bd9639 Implement abstract logger (#2174)
* AbstractLogger base implementation

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Switch most system notifications to AbstractLogger

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Make CLI parser use AbstractLogger

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix annoying QPainter warning in QtColorWidgets

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove obsolete TODOs

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix failing windows build

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add missing #include <cassert>

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-12-21 11:59:08 -06:00
Haris Gušić
6d9768445f Fix screen grab error (#2139)
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-12-02 17:30:57 -06:00
borgmanJeremy
b8c0b74ea2 Qt5 deprications (#2076)
* working on removing deprecated warnings for Qt6 migration

* tewsting 18.04 fix
2021-11-21 14:40:56 -06:00
Haris Gušić
6432490c31 Add --region option (#2013)
* Fix empty help message bug

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add --region option

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix: initial selection even without --region

* Enable 'full --region'

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Enable 'screen --region'

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Allow negative width/height

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix screen intersection bug

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Change output format of --print-geometry

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-11-08 22:59:46 +01:00
borgmanJeremy
e4e7c90109 Gnome41 (#2035)
* testing new portal on gnome41

* applied clang format

* macro out portal API on windows
2021-11-03 08:01:19 -05:00
Haris Gušić
988dcab9de Add --pin, --upload, --accept-on-select to CLI (#1970)
* Add --pin option

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add --upload option

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add --accept-on-select option

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix failing build on MacOS

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Clean up option variable names in main

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove missing --path error

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add tests for action options

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix file extension config option

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix --print-geometry bug

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Replace Qt::endl with "\n"

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix copy/upload task clipboard conflict

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix endless loop when using --raw and --delay

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix bug in upload handling

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Show dialog after upload if --clipboard is set

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix failing build on Mac and Win

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-10-20 11:48:54 -05:00
Haris Gušić
41ca51bc10 Improve screenshot path handling (#1815)
* 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>
2021-08-20 13:10:12 -05:00
Ivan
04cfab4f4d fix: Code typo (#1799) 2021-08-03 20:41:23 -05:00
nullobsi
743f17dd2e clang-format 2021-03-08 11:07:48 -06:00
nullobsi
a3b0cad881 fix compatibility fot Qt < 5.11 2021-03-08 11:07:48 -06:00
nullobsi
6b3e551ce6 use unique token & subscribe to signal before calling screenshot 2021-03-08 11:07:48 -06:00
Yuriy Puchkov
f54538ee1e Code refactoring - ScreenGrabber: 'screen' has been explicitly marked deprecated
(cherry picked from commit 9ffb3fff8cd7ee679070f9e4bfb931b88c960ff6)
2021-03-01 13:14:12 -06:00
Boyuan Yang
a9c7cc7b04 Use SPDX-License-Identifier
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.
2021-02-20 19:22:53 -05:00
Yuriy Puchkov
ebdb3743dd Code refactoring - remove Q_OS_MAC64 (is not required, is covered by Q_OS_DARWIN)
(cherry picked from commit e511b521cec6edd9f77916c6ee753329326a5f91)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
dd54d028a1 Code refactoring - remove Q_OS_MACX (is not required, is covered by Q_OS_DARWIN)
(cherry picked from commit 00b9aae5266aaffb9a01a6f689e1829ae8218bdc)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
a893fdfc75 Code refactoring - remove Q_OS_MAC (deprecated synonym for Q_OS_DARWIN)
(cherry picked from commit aff1649670aa5ba64f2927933a29c62b06fee21f)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
dc7f62ab8d Fix - MacOS - get currentScreen on the edge bottom and right returns nullptr and application crashes
(cherry picked from commit 01ae74fbed34849db485db53ffbdf4a938ebea8e)
2021-02-17 18:46:12 +02:00
nullobsi
ddf69010d8 code formatting 2021-02-02 19:22:05 -06:00
nullobsi
799c4c9908 use device pixel ratio on screenshot to properly draw the image 2021-02-02 19:22:05 -06:00
nullobsi
b4ba730732 disconnect object when done 2021-02-02 19:22:05 -06:00
nullobsi
4c23d2e45d properly exit event loop 2021-02-02 19:22:05 -06:00
nullobsi
7a18dc096a preliminary support for sway/wlroots compositors 2021-02-02 19:22:05 -06:00
Yuriy Puchkov
293525f5b6 Fix - MacOS capture area, full screen mode, system tray area, etc 2020-11-24 07:39:51 -08:00
Peter Cai
e1214e23e5 correct position of QScreen geometry on HiDPI multi-headed setup 2020-09-24 18:17:43 -05:00
Jeremy Borgman
0d5386edd4 Changed clang format to new agreement 2020-09-24 07:53:28 -05:00
Jeremy Borgman
c8d15205be reformatted to Mozilla code style 2020-09-04 20:40:45 -05:00
lupoDharkael
42619158fa Update copyright year 2019-03-04 16:38:45 +01:00
Alfredo Ramos
ee2f583acd Fix some issues detected by Clazy (#384)
* Fix old style connect

* Fix unneeded QString memory allocations
2018-10-24 01:04:42 +02:00
lupoDharkael
affba85666 Remove Wayland duplicated screenshots after dbus calls 2018-09-28 23:31:22 +02:00
Peter Cai
21670e3344 screengrabber: fix devicePixelRatio detection (#277) 2018-07-22 15:30:52 +02:00
Danilo Egêa Gondolfo
df3958e43a Use defined(Q_OS_LINUX) || defined(Q_OS_UNIX) where applicable to support BSD OSs. (#264) 2018-07-01 13:45:49 +02:00
lupoDharkael
c766b3e048 Add capture individual screens option 2018-05-08 21:23:09 +02:00
lupoDharkael
48c058782a Implement single method capture request
The core now has a method requestCapture, which receives a
CaptureRequest object with all the needed information.
This reduces code duplication in future features.
2018-04-29 11:27:55 +02:00
Peter Schuller
48106975fb Fix case statement (so we build with clang). (#101) 2018-01-22 21:15:21 +01:00
lupoDharkael
89ac281033 Fix whitespace consistency 2018-01-19 00:58:40 +01:00
lupoDharkael
3a38abc2ab Add missing license information 2018-01-12 18:10:02 +01:00
lupoDharkael
514195ff41 Don't hardcode temp path 2018-01-12 17:55:19 +01:00
lupoDharkael
77aa604127 Remove dbus from Windows build 2017-12-26 02:00:07 +01:00
lupoDharkael
a5df852268 Add experimental support for captures with compositor 2017-12-15 18:16:33 +01:00
lupoDharkael
bb6ac04d60 Add --raw flag
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.
2017-11-09 18:14:04 +01:00
lupoDharkael
4a56f44bb9 Refactor in the mechanism of saving and exporting
- 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.
2017-08-16 13:44:33 +02:00