[arch-commits] Commit in deepin-screenshot/repos/community-x86_64 (5 files)
Felix Yan
felixonmars at archlinux.org
Wed May 26 17:04:28 UTC 2021
Date: Wednesday, May 26, 2021 @ 17:04:28
Author: felixonmars
Revision: 946804
archrelease: copy trunk to community-x86_64
Added:
deepin-screenshot/repos/community-x86_64/PKGBUILD
(from rev 946803, deepin-screenshot/trunk/PKGBUILD)
deepin-screenshot/repos/community-x86_64/deepin-screenshot-no-notification.patch
(from rev 946803, deepin-screenshot/trunk/deepin-screenshot-no-notification.patch)
deepin-screenshot/repos/community-x86_64/fix_copytoclipboard_in_kde_for_deepin-screenshot.patch
(from rev 946803, deepin-screenshot/trunk/fix_copytoclipboard_in_kde_for_deepin-screenshot.patch)
Deleted:
deepin-screenshot/repos/community-x86_64/PKGBUILD
deepin-screenshot/repos/community-x86_64/deepin-screenshot-no-notification.patch
--------------------------------------------------------+
PKGBUILD | 78 +--
deepin-screenshot-no-notification.patch | 350 +++++++--------
fix_copytoclipboard_in_kde_for_deepin-screenshot.patch | 31 +
3 files changed, 248 insertions(+), 211 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2021-05-26 17:04:03 UTC (rev 946803)
+++ PKGBUILD 2021-05-26 17:04:28 UTC (rev 946804)
@@ -1,36 +0,0 @@
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-# Contributor: Josip Ponjavic <josipponjavic at gmail dot com>
-# Contributor: Xu Fasheng <fasheng.xu[AT]gmail.com>
-
-pkgname=deepin-screenshot
-pkgver=5.0.0
-pkgrel=5
-pkgdesc="Easy-to-use screenshot tool for linuxdeepin desktop environment"
-arch=('x86_64')
-url="https://github.com/linuxdeepin/deepin-screenshot"
-license=('GPL3')
-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)
-sha512sums=('ad073961deaa78a47739af6cf8b0d0fa77a92ee6668c57f9a5bbf51ad2be1d2028681cffabdc26548be1bdbe24c7ccc7e7ff3d49b86907f794495bfbea62aa30'
- 'be84065c3d81b60a3d04180f85b75a58f535a674f8438ee37ffa4f9a9c47128c48a5819d7279a977d64adfb9a25be51ec88f682b0ed632d1c676d6a8af174389')
-
-prepare() {
- cd deepin-screenshot-$pkgver
- patch -p1 -i ../deepin-screenshot-no-notification.patch
- sed -i '1i #include <QPainterPath>' src/widgets/shapeswidget.cpp
-}
-
-build() {
- cd deepin-screenshot-$pkgver
- cmake . -GNinja -DCMAKE_INSTALL_PREFIX=/usr
- ninja
-}
-
-package() {
- cd deepin-screenshot-$pkgver
- DESTDIR="$pkgdir" ninja install
-
- rm "$pkgdir"/usr/share/dbus-1/services/com.deepin.Screenshot.service
-}
Copied: deepin-screenshot/repos/community-x86_64/PKGBUILD (from rev 946803, deepin-screenshot/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2021-05-26 17:04:28 UTC (rev 946804)
@@ -0,0 +1,42 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Josip Ponjavic <josipponjavic at gmail dot com>
+# Contributor: Xu Fasheng <fasheng.xu[AT]gmail.com>
+
+pkgname=deepin-screenshot
+pkgver=5.0.0
+pkgrel=6
+pkgdesc="Easy-to-use screenshot tool for linuxdeepin desktop environment"
+arch=('x86_64')
+url="https://github.com/linuxdeepin/deepin-screenshot"
+license=('GPL3')
+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
+ fix_copytoclipboard_in_kde_for_deepin-screenshot.patch)
+sha512sums=('ad073961deaa78a47739af6cf8b0d0fa77a92ee6668c57f9a5bbf51ad2be1d2028681cffabdc26548be1bdbe24c7ccc7e7ff3d49b86907f794495bfbea62aa30'
+ '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
+}
+
+build() {
+ cd deepin-screenshot-$pkgver
+ cmake . -GNinja -DCMAKE_INSTALL_PREFIX=/usr
+ ninja
+}
+
+package() {
+ cd deepin-screenshot-$pkgver
+ DESTDIR="$pkgdir" ninja install
+
+ rm "$pkgdir"/usr/share/dbus-1/services/com.deepin.Screenshot.service
+}
Deleted: deepin-screenshot-no-notification.patch
===================================================================
--- deepin-screenshot-no-notification.patch 2021-05-26 17:04:03 UTC (rev 946803)
+++ deepin-screenshot-no-notification.patch 2021-05-26 17:04:28 UTC (rev 946804)
@@ -1,175 +0,0 @@
-diff --git a/src/dbusservice/dbusscreenshotservice.cpp b/src/dbusservice/dbusscreenshotservice.cpp
-index 75ea15b..de057f3 100644
---- a/src/dbusservice/dbusscreenshotservice.cpp
-+++ b/src/dbusservice/dbusscreenshotservice.cpp
-@@ -80,8 +80,10 @@ void DBusScreenshotService::NoNotifyScreenshot()
- {
- qDebug() << "DBus screenshot service! nonofiy screenshot";
- // handle method call com.deepin.Screenshot.NoNotify
-- if (!m_singleInstance)
-- parent()->noNotifyScreenshot();
-+ if (!m_singleInstance) {
-+ parent()->noNotify();
-+ parent()->startScreenshot();
-+ }
- m_singleInstance = true;
- }
-
-diff --git a/src/main.cpp b/src/main.cpp
-index 2ce8658..74668c6 100644
---- a/src/main.cpp
-+++ b/src/main.cpp
-@@ -91,6 +91,11 @@ int main(int argc, char *argv[])
- return 0;
- }
-
-+ if (cmdParser.isSet(prohibitNotifyOption)) {
-+ qDebug() << "screenshot no notify!";
-+ w.noNotify();
-+ }
-+
- if (cmdParser.isSet(dbusOption))
- {
- qDebug() << "dbus register waiting!";
-@@ -108,9 +113,6 @@ int main(int argc, char *argv[])
- } else if (cmdParser.isSet(savePathOption)) {
- qDebug() << "cmd savepath screenshot";
- w.savePathScreenshot(cmdParser.value(savePathOption));
-- } else if (cmdParser.isSet(prohibitNotifyOption)) {
-- qDebug() << "screenshot no notify!";
-- w.noNotifyScreenshot();
- } else if (cmdParser.isSet(iconOption)) {
- w.delayScreenshot(0.2);
- } else {
-diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
-index def901e..f1e0a59 100644
---- a/src/mainwindow.cpp
-+++ b/src/mainwindow.cpp
-@@ -1042,8 +1042,9 @@ void MainWindow::saveSpecificedPath(QString path)
-
- QString summary = QString(tr("Picture has been saved to %1")).arg(savePath);
-
-- m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", "",
-- summary, actions, hints, 0);
-+ if (!m_noNotify)
-+ m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", "",
-+ summary, actions, hints, 0);
- exitApp();
- }
-
-@@ -1073,15 +1074,7 @@ void MainWindow::saveSpecificedPath(QString path)
-
- void MainWindow::noNotify()
- {
-- m_controlCenterDBInterface = new DBusControlCenter(this);
-- m_hotZoneInterface = new DBusZone(this);
-- m_interfaceExist = true;
- m_noNotify = true;
--
-- initOriginUI();
-- this->show();
-- initSecondUI();
-- initShortcut();
- }
-
- void MainWindow::topWindow()
-@@ -1414,7 +1407,8 @@ void MainWindow::sendNotify(SaveAction saveAction, QString saveFilePath, const b
- if (!succeed)
- {
- const auto tips = tr("Save failed. Please save it in your home directory.");
-- m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", QString(), tips, QStringList(), QVariantMap(), 0);
-+ if (!m_noNotify)
-+ m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", QString(), tips, QStringList(), QVariantMap(), 0);
-
- exit(0);
- }
-diff --git a/src/mainwindow.h b/src/mainwindow.h
-index d27eade..8915eff 100644
---- a/src/mainwindow.h
-+++ b/src/mainwindow.h
-@@ -72,6 +72,7 @@ public:
- void initShapeWidget(QString type);
- void initDBusInterface();
- void initShortcut();
-+ void noNotify();
-
- signals:
- void deleteShapes();
-@@ -86,7 +87,6 @@ public slots:
- void savePath(const QString &path);
- void saveSpecificedPath(QString path);
- // void delayScreenshot(int num);
-- void noNotify();
- void topWindow();
- void expressSaveScreenshot();
- //Indicate that this program's started by clicking desktop file.
-diff --git a/src/screenshot.cpp b/src/screenshot.cpp
-index 4ced427..94542f4 100644
---- a/src/screenshot.cpp
-+++ b/src/screenshot.cpp
-@@ -38,6 +38,14 @@ Screenshot::Screenshot(QObject *parent)
- void Screenshot::initUI() {
- m_eventContainer = new EventContainer(this);
- m_window = new MainWindow;
-+ if (m_noNotify) {
-+ m_window->noNotify();
-+ }
-+}
-+
-+void Screenshot::noNotify()
-+{
-+ m_noNotify = true;
- }
-
- void Screenshot::startScreenshot()
-@@ -54,7 +62,7 @@ void Screenshot::delayScreenshot(double num)
- QStringList actions = QStringList();
- QVariantMap hints;
- DBusNotify* notifyDBus = new DBusNotify(this);
-- if (num >= 2) {
-+ if (num >= 2 && !m_noNotify) {
- notifyDBus->Notify("Deepin Screenshot", 0, "deepin-screenshot", "",
- summary, actions, hints, 0);
- }
-@@ -82,13 +90,6 @@ void Screenshot::topWindowScreenshot()
- m_window->topWindow();
- }
-
--void Screenshot::noNotifyScreenshot()
--{
-- initUI();
-- m_window->show();
-- m_window->noNotify();
--}
--
- void Screenshot::savePathScreenshot(const QString &path)
- {
- initUI();
-diff --git a/src/screenshot.h b/src/screenshot.h
-index 76d3e72..1c1f0dd 100644
---- a/src/screenshot.h
-+++ b/src/screenshot.h
-@@ -29,12 +29,13 @@ public:
- Screenshot(QObject* parent = 0);
- ~Screenshot();
-
-+ void noNotify();
-+
- public slots:
- void startScreenshot();
- void delayScreenshot(double num);
- void fullscreenScreenshot();
- void topWindowScreenshot();
-- void noNotifyScreenshot();
- void savePathScreenshot(const QString &path);
-
- private:
-@@ -42,7 +43,7 @@ private:
-
- EventContainer* m_eventContainer = nullptr;
- MainWindow* m_window = nullptr;
--
-+ bool m_noNotify = false;
- };
-
- #endif // SCREENSHOT_H
Copied: deepin-screenshot/repos/community-x86_64/deepin-screenshot-no-notification.patch (from rev 946803, deepin-screenshot/trunk/deepin-screenshot-no-notification.patch)
===================================================================
--- deepin-screenshot-no-notification.patch (rev 0)
+++ deepin-screenshot-no-notification.patch 2021-05-26 17:04:28 UTC (rev 946804)
@@ -0,0 +1,175 @@
+diff --git a/src/dbusservice/dbusscreenshotservice.cpp b/src/dbusservice/dbusscreenshotservice.cpp
+index 75ea15b..de057f3 100644
+--- a/src/dbusservice/dbusscreenshotservice.cpp
++++ b/src/dbusservice/dbusscreenshotservice.cpp
+@@ -80,8 +80,10 @@ void DBusScreenshotService::NoNotifyScreenshot()
+ {
+ qDebug() << "DBus screenshot service! nonofiy screenshot";
+ // handle method call com.deepin.Screenshot.NoNotify
+- if (!m_singleInstance)
+- parent()->noNotifyScreenshot();
++ if (!m_singleInstance) {
++ parent()->noNotify();
++ parent()->startScreenshot();
++ }
+ m_singleInstance = true;
+ }
+
+diff --git a/src/main.cpp b/src/main.cpp
+index 2ce8658..74668c6 100644
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -91,6 +91,11 @@ int main(int argc, char *argv[])
+ return 0;
+ }
+
++ if (cmdParser.isSet(prohibitNotifyOption)) {
++ qDebug() << "screenshot no notify!";
++ w.noNotify();
++ }
++
+ if (cmdParser.isSet(dbusOption))
+ {
+ qDebug() << "dbus register waiting!";
+@@ -108,9 +113,6 @@ int main(int argc, char *argv[])
+ } else if (cmdParser.isSet(savePathOption)) {
+ qDebug() << "cmd savepath screenshot";
+ w.savePathScreenshot(cmdParser.value(savePathOption));
+- } else if (cmdParser.isSet(prohibitNotifyOption)) {
+- qDebug() << "screenshot no notify!";
+- w.noNotifyScreenshot();
+ } else if (cmdParser.isSet(iconOption)) {
+ w.delayScreenshot(0.2);
+ } else {
+diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
+index def901e..f1e0a59 100644
+--- a/src/mainwindow.cpp
++++ b/src/mainwindow.cpp
+@@ -1042,8 +1042,9 @@ void MainWindow::saveSpecificedPath(QString path)
+
+ QString summary = QString(tr("Picture has been saved to %1")).arg(savePath);
+
+- m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", "",
+- summary, actions, hints, 0);
++ if (!m_noNotify)
++ m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", "",
++ summary, actions, hints, 0);
+ exitApp();
+ }
+
+@@ -1073,15 +1074,7 @@ void MainWindow::saveSpecificedPath(QString path)
+
+ void MainWindow::noNotify()
+ {
+- m_controlCenterDBInterface = new DBusControlCenter(this);
+- m_hotZoneInterface = new DBusZone(this);
+- m_interfaceExist = true;
+ m_noNotify = true;
+-
+- initOriginUI();
+- this->show();
+- initSecondUI();
+- initShortcut();
+ }
+
+ void MainWindow::topWindow()
+@@ -1414,7 +1407,8 @@ void MainWindow::sendNotify(SaveAction saveAction, QString saveFilePath, const b
+ if (!succeed)
+ {
+ const auto tips = tr("Save failed. Please save it in your home directory.");
+- m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", QString(), tips, QStringList(), QVariantMap(), 0);
++ if (!m_noNotify)
++ m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", QString(), tips, QStringList(), QVariantMap(), 0);
+
+ exit(0);
+ }
+diff --git a/src/mainwindow.h b/src/mainwindow.h
+index d27eade..8915eff 100644
+--- a/src/mainwindow.h
++++ b/src/mainwindow.h
+@@ -72,6 +72,7 @@ public:
+ void initShapeWidget(QString type);
+ void initDBusInterface();
+ void initShortcut();
++ void noNotify();
+
+ signals:
+ void deleteShapes();
+@@ -86,7 +87,6 @@ public slots:
+ void savePath(const QString &path);
+ void saveSpecificedPath(QString path);
+ // void delayScreenshot(int num);
+- void noNotify();
+ void topWindow();
+ void expressSaveScreenshot();
+ //Indicate that this program's started by clicking desktop file.
+diff --git a/src/screenshot.cpp b/src/screenshot.cpp
+index 4ced427..94542f4 100644
+--- a/src/screenshot.cpp
++++ b/src/screenshot.cpp
+@@ -38,6 +38,14 @@ Screenshot::Screenshot(QObject *parent)
+ void Screenshot::initUI() {
+ m_eventContainer = new EventContainer(this);
+ m_window = new MainWindow;
++ if (m_noNotify) {
++ m_window->noNotify();
++ }
++}
++
++void Screenshot::noNotify()
++{
++ m_noNotify = true;
+ }
+
+ void Screenshot::startScreenshot()
+@@ -54,7 +62,7 @@ void Screenshot::delayScreenshot(double num)
+ QStringList actions = QStringList();
+ QVariantMap hints;
+ DBusNotify* notifyDBus = new DBusNotify(this);
+- if (num >= 2) {
++ if (num >= 2 && !m_noNotify) {
+ notifyDBus->Notify("Deepin Screenshot", 0, "deepin-screenshot", "",
+ summary, actions, hints, 0);
+ }
+@@ -82,13 +90,6 @@ void Screenshot::topWindowScreenshot()
+ m_window->topWindow();
+ }
+
+-void Screenshot::noNotifyScreenshot()
+-{
+- initUI();
+- m_window->show();
+- m_window->noNotify();
+-}
+-
+ void Screenshot::savePathScreenshot(const QString &path)
+ {
+ initUI();
+diff --git a/src/screenshot.h b/src/screenshot.h
+index 76d3e72..1c1f0dd 100644
+--- a/src/screenshot.h
++++ b/src/screenshot.h
+@@ -29,12 +29,13 @@ public:
+ Screenshot(QObject* parent = 0);
+ ~Screenshot();
+
++ void noNotify();
++
+ public slots:
+ void startScreenshot();
+ void delayScreenshot(double num);
+ void fullscreenScreenshot();
+ void topWindowScreenshot();
+- void noNotifyScreenshot();
+ void savePathScreenshot(const QString &path);
+
+ private:
+@@ -42,7 +43,7 @@ private:
+
+ EventContainer* m_eventContainer = nullptr;
+ MainWindow* m_window = nullptr;
+-
++ bool m_noNotify = false;
+ };
+
+ #endif // SCREENSHOT_H
Copied: deepin-screenshot/repos/community-x86_64/fix_copytoclipboard_in_kde_for_deepin-screenshot.patch (from rev 946803, deepin-screenshot/trunk/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:28 UTC (rev 946804)
@@ -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