From 5c8244fef8298d7276a255a80b0f9b428321f7ba Mon Sep 17 00:00:00 2001 From: borgmanJeremy <46930769+borgmanJeremy@users.noreply.github.com> Date: Mon, 7 Apr 2025 03:02:45 -0500 Subject: [PATCH 1/5] Bumped minimum Cmake version to fix build issues on Cmake 4.0. (#3901) * Bumped minimum Cmake version to fix build issues on Cmake 4.0. 3.22 was chosen since that is the version on Ubuntu 22.04 * lowered cmake version to 3.18 for debian bullseye --- external/Qt-Color-Widgets/CMakeLists.txt | 6 ++---- .../color_widgets_designer_plugin/CMakeLists.txt | 2 +- external/singleapplication/CMakeLists.txt | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/external/Qt-Color-Widgets/CMakeLists.txt b/external/Qt-Color-Widgets/CMakeLists.txt index b9d2775cc4..298a20b267 100644 --- a/external/Qt-Color-Widgets/CMakeLists.txt +++ b/external/Qt-Color-Widgets/CMakeLists.txt @@ -14,10 +14,8 @@ # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see . # -cmake_minimum_required (VERSION 3.1 FATAL_ERROR) -if ( ${CMAKE_VERSION} VERSION_GREATER "3.12.0") - cmake_policy(SET CMP0077 NEW) -endif() +cmake_minimum_required (VERSION 3.18 FATAL_ERROR) +cmake_policy(SET CMP0077 NEW) set(COLORWIDGET_PROJECT_NAME QtColorWidgets) project(${COLORWIDGET_PROJECT_NAME} CXX) diff --git a/external/Qt-Color-Widgets/color_widgets_designer_plugin/CMakeLists.txt b/external/Qt-Color-Widgets/color_widgets_designer_plugin/CMakeLists.txt index 1c0504ef00..aa0799ce29 100644 --- a/external/Qt-Color-Widgets/color_widgets_designer_plugin/CMakeLists.txt +++ b/external/Qt-Color-Widgets/color_widgets_designer_plugin/CMakeLists.txt @@ -14,7 +14,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Color Widgets. If not, see . -cmake_minimum_required (VERSION 3.1 FATAL_ERROR) +cmake_minimum_required (VERSION 3.18 FATAL_ERROR) project(QtColorWidgetsPlugin CXX) diff --git a/external/singleapplication/CMakeLists.txt b/external/singleapplication/CMakeLists.txt index 85dba84ce0..49ddfa00da 100644 --- a/external/singleapplication/CMakeLists.txt +++ b/external/singleapplication/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7.0) +cmake_minimum_required(VERSION 3.18.0) project(SingleApplication LANGUAGES CXX) From 63a4ab669bba83bdde878963df80a3c4e9331e21 Mon Sep 17 00:00:00 2001 From: Justus Springer <50165510+justus-springer@users.noreply.github.com> Date: Mon, 7 Apr 2025 10:06:59 +0200 Subject: [PATCH 2/5] Add last-region option to manpage and shell completions (#3893) * add --last-region to manpage * Add shell completions for --last-region --- data/man/man1/flameshot.1 | 8 ++++++++ data/shell-completion/flameshot.bash | 6 +++--- data/shell-completion/flameshot.fish | 3 +++ data/shell-completion/flameshot.zsh | 3 +++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/data/man/man1/flameshot.1 b/data/man/man1/flameshot.1 index 5ca9ec2b1a..68464f23fb 100644 --- a/data/man/man1/flameshot.1 +++ b/data/man/man1/flameshot.1 @@ -147,6 +147,14 @@ Valid for subcommands: config .RE . .PP +\-\-last-region +.RS 4 +Repeat screenshot with previously selected region +.br +Valid for subcommands: full, gui, screen +.RE +. +.PP \-m, \-\-maincolor .RS 4 Define the main UI color diff --git a/data/shell-completion/flameshot.bash b/data/shell-completion/flameshot.bash index cdca386956..f9faa14177 100644 --- a/data/shell-completion/flameshot.bash +++ b/data/shell-completion/flameshot.bash @@ -11,9 +11,9 @@ _flameshot() { prev="${COMP_WORDS[COMP_CWORD-1]}" cur="${COMP_WORDS[COMP_CWORD]}" cmd="gui full config launcher screen" - screen_opts="--number --path --delay --raw -p -d -r -n" - gui_opts="--path --delay --raw -p -d -r" - full_opts="--path --delay --clipboard --raw -p -d -c -r" + screen_opts="--number --path --delay --raw --last-region -p -d -r -n" + gui_opts="--path --delay --raw --last-region -p -d -r" + full_opts="--path --delay --clipboard --raw --last-region -p -d -c -r" config_opts="--contrastcolor --filename --maincolor --showhelp --trayicon --autostart -k -f -m -s -t -a" case "${prev}" in diff --git a/data/shell-completion/flameshot.fish b/data/shell-completion/flameshot.fish index 07d96a1e8d..aefd191c3a 100644 --- a/data/shell-completion/flameshot.fish +++ b/data/shell-completion/flameshot.fish @@ -78,6 +78,7 @@ __flameshot_complete gui -l "path" -s "p" -rk -d "Output file or __flameshot_complete gui -l "clipboard" -s "c" -f -d "Copy screenshot to the clipboard" __flameshot_complete gui -l "delay" -s "d" -frk -d "Delay time in milliseconds" __flameshot_complete gui -l "region" -frk -d "Screenshot region to select (WxH+X+Y)" -a "(__flameshot_complete_region gui)" +__flameshot_complete gui -l "last-region" -f -d "Repeat screenshot with previously selected region" __flameshot_complete gui -l "raw" -s "r" -f -d "Print raw PNG capture" __flameshot_complete gui -l "print-geometry" -s "g" -f -d "Print geometry of the selection" __flameshot_complete gui -l "upload" -s "u" -f -d "Upload the screenshot" @@ -91,6 +92,7 @@ __flameshot_complete screen -l "path" -s "p" -rk -d "Output file or __flameshot_complete screen -l "clipboard" -s "c" -f -d "Copy screenshot to the clipboard" __flameshot_complete screen -l "delay" -s "d" -frk -d "Delay time in milliseconds" __flameshot_complete screen -l "region" -frk -d "Screenshot region to select (WxH+X+Y)" -a "(__flameshot_complete_region screen)" +__flameshot_complete screen -l "last-region" -f -d "Repeat screenshot with previously selected region" __flameshot_complete screen -l "raw" -s "r" -f -d "Print raw PNG capture" __flameshot_complete screen -l "upload" -s "u" -f -d "Upload the screenshot" __flameshot_complete screen -l "pin" -f -d "Pin the screenshot to the screen" @@ -101,6 +103,7 @@ __flameshot_complete full -l "path" -s "p" -rk -d "Output file or __flameshot_complete full -l "clipboard" -s "c" -f -d "Copy screenshot to the clipboard" __flameshot_complete full -l "delay" -s "d" -frk -d "Delay time in milliseconds" __flameshot_complete full -l "region" -frk -d "Screenshot region to select (WxH+X+Y)" -a "(__flameshot_complete_region full)" +__flameshot_complete full -l "last-region" -f -d "Repeat screenshot with previously selected region" __flameshot_complete full -l "raw" -s "r" -f -d "Print raw PNG capture" __flameshot_complete full -l "upload" -s "u" -f -d "Upload the screenshot" diff --git a/data/shell-completion/flameshot.zsh b/data/shell-completion/flameshot.zsh index 226276ceac..eaa6fb3413 100644 --- a/data/shell-completion/flameshot.zsh +++ b/data/shell-completion/flameshot.zsh @@ -21,6 +21,7 @@ _flameshot_gui_opts=( {-c,--clipboard}'[Save the capture to the clipboard]' {-d,--delay}'[Delay time in milliseconds]' "--region[Screenshot region to select ]" + "--last-region[Repeat screenshot with previously selected region]" {-r,--raw}'[Print raw PNG capture]' {-g,--print-geometry}'[Print geometry of the selection in the format WxH+X+Y. Does nothing if raw is specified]' {-u,--upload}'[Upload screenshot]' @@ -42,6 +43,7 @@ _flameshot_screen_opts=( {-c,--clipboard}'[Save the capture to the clipboard]' {-d,--delay}'[Delay time in milliseconds]' "--region[Screenshot region to select ]" + "--last-region[Repeat screenshot with previously selected region]" {-r,--raw}'[Print raw PNG capture]' {-u,--upload}'[Upload screenshot]' "--pin[Pin the capture to the screen]" @@ -60,6 +62,7 @@ _flameshot_full_opts=( {-c,--clipboard}'[Save the capture to the clipboard]' {-d,--delay}'[Delay time in milliseconds]' "--region[Screenshot region to select ]" + "--last-region[Repeat screenshot with previously selected region]" {-r,--raw}'[Print raw PNG capture]' {-u,--upload}'[Upload screenshot]' ) From 5b7d41c7e63bc87aff5ffc4e588ac4408fe82e4b Mon Sep 17 00:00:00 2001 From: lhz07 <57289801+lhz07@users.noreply.github.com> Date: Sun, 27 Apr 2025 22:16:15 +0800 Subject: [PATCH 3/5] Improve the speed of calling grim (#3859) --- src/utils/screengrabber.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils/screengrabber.cpp b/src/utils/screengrabber.cpp index 9ce3854f43..8e28750350 100644 --- a/src/utils/screengrabber.cpp +++ b/src/utils/screengrabber.cpp @@ -31,13 +31,17 @@ void ScreenGrabber::generalGrimScreenshot(bool& ok, QPixmap& res) { #ifdef USE_WAYLAND_GRIM #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) + QString runDir = QProcessEnvironment::systemEnvironment().value("XDG_RUNTIME_DIR"); + QString imgPath = runDir + "/flameshot.ppm"; QProcess Process; QString program = "grim"; QStringList arguments; - arguments << "-"; + arguments << "-t" << "ppm" << imgPath; Process.start(program, arguments); if (Process.waitForFinished()) { - res.loadFromData(Process.readAll()); + res.load(imgPath, "ppm"); + QFile imgFile(imgPath); + imgFile.remove(); ok = true; } else { ok = false; From b35f977c7458af0cddb7d2a754521b2134d1cbbb Mon Sep 17 00:00:00 2001 From: Allen Guo Date: Sun, 27 Apr 2025 22:18:17 +0800 Subject: [PATCH 4/5] enable PinWidget scrolling on macos with mouse (#3860) --- src/tools/pin/pinwidget.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tools/pin/pinwidget.cpp b/src/tools/pin/pinwidget.cpp index a1a0ace5c0..74f18faacc 100644 --- a/src/tools/pin/pinwidget.cpp +++ b/src/tools/pin/pinwidget.cpp @@ -106,8 +106,7 @@ bool PinWidget::scrollEvent(QWheelEvent* event) { const auto phase = event->phase(); if (phase == Qt::ScrollPhase::ScrollUpdate -#if defined(Q_OS_LINUX) || defined(Q_OS_WINDOWS) - // Linux is getting only NoScrollPhase events. +#if defined(Q_OS_LINUX) || defined(Q_OS_WINDOWS) || defined(Q_OS_MACOS) || phase == Qt::ScrollPhase::NoScrollPhase #endif ) { From 68594dba757ba2d155236a1b222e91854da9ffb1 Mon Sep 17 00:00:00 2001 From: Matthias Adler Date: Sun, 27 Apr 2025 16:27:33 +0200 Subject: [PATCH 5/5] fix: add missing appstream data for flatpak builder (#3911) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit updates appstream data to pass strict validation, which is necessary to build new Flatpak versions. Flatpak builder added strict validation and requires "developer" information [1] to be provided. Build error: ``` Run docker run --rm --privileged \ + flatpak-builder-lint --exceptions repo repo { "errors": [ "appstream-missing-developer-name" ], "warnings": [ "appstream-screenshot-missing-caption" ], "info": [ "appstream-screenshot-missing-caption: One or more screenshots are missing captions in the Metainfo file", "appstream-missing-developer-name: No developer tag found in Metainfo file" ], "message": "Please consult the documentation at https://docs.flathub.org/docs/for-app-authors/linter" } error: Recipe `validate-build` failed with exit code 1 ``` For good measure, captions for the provided screenshots are added. After changes made, `appstreamcli validate` only mentions issue with uppercase cid component which should be kept as is: ```sh $ appstreamcli validate --pedantic data/appdata/org.flameshot.Flameshot.metainfo.xml P: org.flameshot.Flameshot:7: cid-contains-uppercase-letter org.flameshot.Flameshot ✔ Validation was successful: pedantic: 1 ``` [1]: https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines#developer-name --- data/appdata/org.flameshot.Flameshot.metainfo.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/appdata/org.flameshot.Flameshot.metainfo.xml b/data/appdata/org.flameshot.Flameshot.metainfo.xml index a4242951c2..32aa6af728 100644 --- a/data/appdata/org.flameshot.Flameshot.metainfo.xml +++ b/data/appdata/org.flameshot.Flameshot.metainfo.xml @@ -8,6 +8,9 @@ SPDX-License-Identifier: CC0-1.0 CC0-1.0 GPL-3.0-or-later Flameshot + + Flameshot Developers + @@ -33,9 +36,11 @@ SPDX-License-Identifier: CC0-1.0 https://raw.githubusercontent.com/flameshot-org/flameshot/master/data/img/preview/usageStatic.png + Flameshot Usage https://raw.githubusercontent.com/flameshot-org/flameshot/master/data/img/preview/animatedUsage.gif + Animated Flameshot Usage https://github.com/flameshot-org/flameshot