From c47e391de8a0e554cace8a9b0bcddb8bbb46cbcc Mon Sep 17 00:00:00 2001 From: Sebastian Moser Date: Thu, 30 Jan 2025 18:02:59 +0100 Subject: [PATCH] a flameshot patch, that does not work... --- overlays/patches/flameshot-wayland.patch | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 overlays/patches/flameshot-wayland.patch diff --git a/overlays/patches/flameshot-wayland.patch b/overlays/patches/flameshot-wayland.patch new file mode 100644 index 0000000..49a3530 --- /dev/null +++ b/overlays/patches/flameshot-wayland.patch @@ -0,0 +1,46 @@ +diff --git a/src/core/flameshotdaemon.cpp b/src/core/flameshotdaemon.cpp +index b8fdf3cd..b8abd70f 100644 +--- a/src/core/flameshotdaemon.cpp ++++ b/src/core/flameshotdaemon.cpp +@@ -29,6 +29,11 @@ + #include "src/core/globalshortcutfilter.h" + #endif + ++#if USE_WAYLAND_CLIPBOARD ++#include ++#include ++#endif ++ + /** + * @brief A way of accessing the flameshot daemon both from the daemon itself, + * and from subcommands. +@@ -313,14 +318,22 @@ void FlameshotDaemon::attachTextToClipboard(const QString& text, + } + + m_hostingClipboard = true; +- QClipboard* clipboard = QApplication::clipboard(); + +- clipboard->blockSignals(true); +- // This variable is necessary because the signal doesn't get blocked on +- // windows for some reason +- m_clipboardSignalBlocked = true; +- clipboard->setText(text); +- clipboard->blockSignals(false); ++ #ifdef USE_WAYLAND_CLIPBOARD ++ auto* mimeData = new QMimeData(); ++ mimeData->setText(text); ++ KSystemClipboard::instance()->setMimeData(mimeData, ++ QClipboard::Clipboard); ++ #else ++ QClipboard* clipboard = QApplication::clipboard(); ++ ++ clipboard->blockSignals(true); ++ // This variable is necessary because the signal doesn't get blocked on ++ // windows for some reason ++ m_clipboardSignalBlocked = true; ++ clipboard->setText(text); ++ clipboard->blockSignals(false); ++ #endif + } + + void FlameshotDaemon::initTrayIcon()