From 0c9434090ea9891b7f78a87b9318a54c7e122b02 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Tue, 26 Apr 2016 09:28:07 -0500 Subject: [PATCH] backport upstream fixes --- .gitignore | 2 - 0003-Unbreak-HiDPI.patch | 41 ++++++++++++++ ...angular-image-grabs-for-nvidia-users.patch | 56 +++++++++++++++++++ spectacle.spec | 11 +++- 4 files changed, 106 insertions(+), 4 deletions(-) create mode 100644 0003-Unbreak-HiDPI.patch create mode 100644 0004-Unbreak-rectangular-image-grabs-for-nvidia-users.patch diff --git a/.gitignore b/.gitignore index d148292..5b3b009 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -/spectacle-15.12.3.tar.xz -/spectacle-16.03.80.tar.xz /spectacle-16.04.0.tar.xz diff --git a/0003-Unbreak-HiDPI.patch b/0003-Unbreak-HiDPI.patch new file mode 100644 index 0000000..f5ea477 --- /dev/null +++ b/0003-Unbreak-HiDPI.patch @@ -0,0 +1,41 @@ +From 3d4dcacc6cbbd75f9d31d26bfa2a1f2ced37f721 Mon Sep 17 00:00:00 2001 +From: Boudhayan Gupta +Date: Mon, 25 Apr 2016 23:15:43 +0530 +Subject: [PATCH 3/4] Unbreak HiDPI + +--- + src/QuickEditor/EditorRoot.qml | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/QuickEditor/EditorRoot.qml b/src/QuickEditor/EditorRoot.qml +index 55c6177..f7fb33b 100644 +--- a/src/QuickEditor/EditorRoot.qml ++++ b/src/QuickEditor/EditorRoot.qml +@@ -36,10 +36,10 @@ Item { + } + + selection = cropRectangle.createObject(parent, { +- "x": xx, +- "y": yy, ++ "x": xx, ++ "y": yy, + "height": hh, +- "width": ww ++ "width": ww + }); + + cropDisplayCanvas.requestPaint(); +@@ -73,8 +73,8 @@ Item { + source: "image://snapshot/rawimage"; + cache: false; + +- height: Window.height; +- width: Window.width; ++ height: Window.height / Screen.devicePixelRatio; ++ width: Window.width / Screen.devicePixelRatio; + fillMode: Image.PreserveAspectFit; + } + +-- +2.7.4 + diff --git a/0004-Unbreak-rectangular-image-grabs-for-nvidia-users.patch b/0004-Unbreak-rectangular-image-grabs-for-nvidia-users.patch new file mode 100644 index 0000000..d344370 --- /dev/null +++ b/0004-Unbreak-rectangular-image-grabs-for-nvidia-users.patch @@ -0,0 +1,56 @@ +From abbbe6d13de870f9e9349acc2542cffc5d41b76d Mon Sep 17 00:00:00 2001 +From: Boudhayan Gupta +Date: Mon, 25 Apr 2016 23:57:49 +0530 +Subject: [PATCH 4/4] Unbreak rectangular image grabs for nvidia users. + +BUG: 362241 +FIXED-IN: 16.04.1 +--- + src/QuickEditor/QuickEditor.cpp | 19 +------------------ + src/QuickEditor/QuickEditor.h | 1 - + 2 files changed, 1 insertion(+), 19 deletions(-) + +diff --git a/src/QuickEditor/QuickEditor.cpp b/src/QuickEditor/QuickEditor.cpp +index 81a8fd0..a9bb72f 100644 +--- a/src/QuickEditor/QuickEditor.cpp ++++ b/src/QuickEditor/QuickEditor.cpp +@@ -138,23 +138,6 @@ void QuickEditor::acceptImageHandler(int x, int y, int width, int height) + d->mGrabRect = QRect(x, y, width, height); + SpectacleConfig::instance()->setCropRegion(d->mGrabRect); + +- QQuickItem *target = d->mQuickView->rootObject()->findChild(QStringLiteral("imageBackground")); +- d->mCurrentGrabResult = target->grabToImage(); +- if (d->mCurrentGrabResult.isNull()) { +- emit grabCancelled(); +- return; +- } +- +- connect(d->mCurrentGrabResult.data(), &QQuickItemGrabResult::ready, this, &QuickEditor::grabReadyHandler); +-} +- +-void QuickEditor::grabReadyHandler() +-{ +- Q_D(QuickEditor); +- +- QImage croppedImage = d->mCurrentGrabResult->image().copy(d->mGrabRect); +- QPixmap croppedPixmap = QPixmap::fromImage(croppedImage); +- + d->mQuickView->hide(); +- emit grabDone(croppedPixmap, d->mGrabRect); ++ emit grabDone(mImageStore->mPixmap.copy(d->mGrabRect), d->mGrabRect); + } +diff --git a/src/QuickEditor/QuickEditor.h b/src/QuickEditor/QuickEditor.h +index cadd5bb..5cca825 100644 +--- a/src/QuickEditor/QuickEditor.h ++++ b/src/QuickEditor/QuickEditor.h +@@ -39,7 +39,6 @@ class QuickEditor : public QObject + private slots: + + void acceptImageHandler(int x, int y, int width, int height); +- void grabReadyHandler(); + + private: + +-- +2.7.4 + diff --git a/spectacle.spec b/spectacle.spec index af8722c..4d73e15 100644 --- a/spectacle.spec +++ b/spectacle.spec @@ -2,7 +2,7 @@ Name: spectacle Summary: Screenshot capture utility Version: 16.04.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 URL: https://quickgit.kde.org/?p=%{name}.git @@ -15,6 +15,10 @@ URL: https://quickgit.kde.org/?p=%{name}.git %endif Source0: http://download.kde.org/%{stable}/applications/%{version}/src/%{name}-%{version}.tar.xz +## upstream patches +Patch3: 0003-Unbreak-HiDPI.patch +Patch4: 0004-Unbreak-rectangular-image-grabs-for-nvidia-users.patch + %global majmin_ver %(echo %{version} | cut -d. -f1,2) BuildRequires: desktop-file-utils @@ -47,7 +51,7 @@ BuildRequires: pkgconfig(xcb-xfixes) %prep -%autosetup +%autosetup -p1 %build @@ -92,6 +96,9 @@ fi %changelog +* Tue Apr 26 2016 Rex Dieter - 16.04.0-2 +- backport upstream fixes + * Fri Apr 15 2016 Rex Dieter - 16.04.0-1 - 16.04.0