[arch-commits] Commit in deepin-screenshot/trunk (2 files)

Felix Yan felixonmars at archlinux.org
Wed May 26 17:04:04 UTC 2021


    Date: Wednesday, May 26, 2021 @ 17:04:03
  Author: felixonmars
Revision: 946803

Add a patch to fix copy to clipboard on KDE

Added:
  deepin-screenshot/trunk/fix_copytoclipboard_in_kde_for_deepin-screenshot.patch
Modified:
  deepin-screenshot/trunk/PKGBUILD

--------------------------------------------------------+
 PKGBUILD                                               |   12 ++++-
 fix_copytoclipboard_in_kde_for_deepin-screenshot.patch |   31 +++++++++++++++
 2 files changed, 40 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-05-26 16:52:30 UTC (rev 946802)
+++ PKGBUILD	2021-05-26 17:04:03 UTC (rev 946803)
@@ -4,7 +4,7 @@
 
 pkgname=deepin-screenshot
 pkgver=5.0.0
-pkgrel=5
+pkgrel=6
 pkgdesc="Easy-to-use screenshot tool for linuxdeepin desktop environment"
 arch=('x86_64')
 url="https://github.com/linuxdeepin/deepin-screenshot"
@@ -12,13 +12,19 @@
 depends=('deepin-qt5integration' 'dtkwm' 'deepin-turbo')
 makedepends=('cmake' 'ninja' 'qt5-tools')
 source=("$pkgname-$pkgver.tar.gz::https://github.com/linuxdeepin/deepin-screenshot/archive/$pkgver.tar.gz"
-        deepin-screenshot-no-notification.patch)
+        deepin-screenshot-no-notification.patch
+        fix_copytoclipboard_in_kde_for_deepin-screenshot.patch)
 sha512sums=('ad073961deaa78a47739af6cf8b0d0fa77a92ee6668c57f9a5bbf51ad2be1d2028681cffabdc26548be1bdbe24c7ccc7e7ff3d49b86907f794495bfbea62aa30'
-            'be84065c3d81b60a3d04180f85b75a58f535a674f8438ee37ffa4f9a9c47128c48a5819d7279a977d64adfb9a25be51ec88f682b0ed632d1c676d6a8af174389')
+            'be84065c3d81b60a3d04180f85b75a58f535a674f8438ee37ffa4f9a9c47128c48a5819d7279a977d64adfb9a25be51ec88f682b0ed632d1c676d6a8af174389'
+            'f00ff0e15f0e7a76927594c4affe8fac557580ffe02b21669067d8ad03b121e30eb272e8984db8862047db914118b4ad21d6c20f438a51a884e0351426452c2a')
 
 prepare() {
   cd deepin-screenshot-$pkgver
   patch -p1 -i ../deepin-screenshot-no-notification.patch
+
+  # Rebased from https://gist.github.com/springzfx/f881dff2d1c89efbfe59cfc288e09462
+  patch -p1 -i ../fix_copytoclipboard_in_kde_for_deepin-screenshot.patch
+
   sed -i '1i #include <QPainterPath>' src/widgets/shapeswidget.cpp
 }
 

Added: fix_copytoclipboard_in_kde_for_deepin-screenshot.patch
===================================================================
--- fix_copytoclipboard_in_kde_for_deepin-screenshot.patch	                        (rev 0)
+++ fix_copytoclipboard_in_kde_for_deepin-screenshot.patch	2021-05-26 17:04:03 UTC (rev 946803)
@@ -0,0 +1,31 @@
+diff --git a/src/mainwindow.cpp.orig b/src/mainwindow.cpp
+index f1e0a59..8350862 100644
+--- a/src/mainwindow.cpp.orig
++++ b/src/mainwindow.cpp
+@@ -1395,7 +1395,16 @@ bool MainWindow::saveAction(const QPixmap &pix)
+     if (copyToClipboard) {
+         Q_ASSERT(!screenShotPix.isNull());
+         QClipboard* cb = qApp->clipboard();
+-        cb->setPixmap(screenShotPix, QClipboard::Clipboard);
++        // On X11 clipboard content is owned by the application,
++        // Data copied to clipboard remains in the clipboard only
++        // as long as the parent application is running and is discarded when the application quits.
++        // Added "x-kde-force-image-copy" mime type to screenshots being copied to clipboard,
++        // which forces klipper clipboard manager to remember this clipboard entry
++        // even if user has set "ignore images" option to true in klipper.
++        QMimeData *data = new QMimeData();
++        data->setImageData(screenShotPix.toImage());
++        data->setData(QStringLiteral("x-kde-force-image-copy"), QByteArray());
++        cb->setMimeData(data, QClipboard::Clipboard);
+     }
+ 
+     return true;
+@@ -1455,7 +1464,7 @@ void MainWindow::sendNotify(SaveAction saveAction, QString saveFilePath, const b
+                                     summary, actions, hints, 0);
+     }
+ 
+-    QTimer::singleShot(2, [=]{
++    QTimer::singleShot(500, [=]{
+         exitApp();
+     });
+ 



More information about the arch-commits mailing list