Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 8f16773

Browse files
felixonmarssvntogit
authored andcommitted
Add a patch to fix copy to clipboard on KDE
git-svn-id: file:///srv/repos/svn-community/svn@946803 9fca08f4-af9d-4005-b8df-a31f2cc04f65
1 parent 59ee590 commit 8f16773

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

trunk/PKGBUILD

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,27 @@
44

55
pkgname=deepin-screenshot
66
pkgver=5.0.0
7-
pkgrel=5
7+
pkgrel=6
88
pkgdesc="Easy-to-use screenshot tool for linuxdeepin desktop environment"
99
arch=('x86_64')
1010
url="https://github.com/linuxdeepin/deepin-screenshot"
1111
license=('GPL3')
1212
depends=('deepin-qt5integration' 'dtkwm' 'deepin-turbo')
1313
makedepends=('cmake' 'ninja' 'qt5-tools')
1414
source=("$pkgname-$pkgver.tar.gz::https://github.com/linuxdeepin/deepin-screenshot/archive/$pkgver.tar.gz"
15-
deepin-screenshot-no-notification.patch)
15+
deepin-screenshot-no-notification.patch
16+
fix_copytoclipboard_in_kde_for_deepin-screenshot.patch)
1617
sha512sums=('ad073961deaa78a47739af6cf8b0d0fa77a92ee6668c57f9a5bbf51ad2be1d2028681cffabdc26548be1bdbe24c7ccc7e7ff3d49b86907f794495bfbea62aa30'
17-
'be84065c3d81b60a3d04180f85b75a58f535a674f8438ee37ffa4f9a9c47128c48a5819d7279a977d64adfb9a25be51ec88f682b0ed632d1c676d6a8af174389')
18+
'be84065c3d81b60a3d04180f85b75a58f535a674f8438ee37ffa4f9a9c47128c48a5819d7279a977d64adfb9a25be51ec88f682b0ed632d1c676d6a8af174389'
19+
'f00ff0e15f0e7a76927594c4affe8fac557580ffe02b21669067d8ad03b121e30eb272e8984db8862047db914118b4ad21d6c20f438a51a884e0351426452c2a')
1820

1921
prepare() {
2022
cd deepin-screenshot-$pkgver
2123
patch -p1 -i ../deepin-screenshot-no-notification.patch
24+
25+
# Rebased from https://gist.github.com/springzfx/f881dff2d1c89efbfe59cfc288e09462
26+
patch -p1 -i ../fix_copytoclipboard_in_kde_for_deepin-screenshot.patch
27+
2228
sed -i '1i #include <QPainterPath>' src/widgets/shapeswidget.cpp
2329
}
2430

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
diff --git a/src/mainwindow.cpp.orig b/src/mainwindow.cpp
2+
index f1e0a59..8350862 100644
3+
--- a/src/mainwindow.cpp.orig
4+
+++ b/src/mainwindow.cpp
5+
@@ -1395,7 +1395,16 @@ bool MainWindow::saveAction(const QPixmap &pix)
6+
if (copyToClipboard) {
7+
Q_ASSERT(!screenShotPix.isNull());
8+
QClipboard* cb = qApp->clipboard();
9+
- cb->setPixmap(screenShotPix, QClipboard::Clipboard);
10+
+ // On X11 clipboard content is owned by the application,
11+
+ // Data copied to clipboard remains in the clipboard only
12+
+ // as long as the parent application is running and is discarded when the application quits.
13+
+ // Added "x-kde-force-image-copy" mime type to screenshots being copied to clipboard,
14+
+ // which forces klipper clipboard manager to remember this clipboard entry
15+
+ // even if user has set "ignore images" option to true in klipper.
16+
+ QMimeData *data = new QMimeData();
17+
+ data->setImageData(screenShotPix.toImage());
18+
+ data->setData(QStringLiteral("x-kde-force-image-copy"), QByteArray());
19+
+ cb->setMimeData(data, QClipboard::Clipboard);
20+
}
21+
22+
return true;
23+
@@ -1455,7 +1464,7 @@ void MainWindow::sendNotify(SaveAction saveAction, QString saveFilePath, const b
24+
summary, actions, hints, 0);
25+
}
26+
27+
- QTimer::singleShot(2, [=]{
28+
+ QTimer::singleShot(500, [=]{
29+
exitApp();
30+
});
31+

0 commit comments

Comments
 (0)