summaryrefslogtreecommitdiffstats
path: root/kde/patch/spectacle/spectacle_rect_capture.patch
blob: ee77216982995be92e9e8f07acd711908a8e35f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From: Boudhayan Gupta <me@BaloneyGeek.com>
Date: Mon, 25 Apr 2016 18:27:49 +0000
Subject: Unbreak rectangular image grabs for nvidia users.
X-Git-Url: http://quickgit.kde.org/?p=spectacle.git&a=commitdiff&h=abbbe6d13de870f9e9349acc2542cffc5d41b76d
---
Unbreak rectangular image grabs for nvidia users.

BUG: 362241
FIXED-IN: 16.04.1
---


--- a/src/QuickEditor/QuickEditor.cpp
+++ b/src/QuickEditor/QuickEditor.cpp
@@ -138,24 +138,7 @@
     d->mGrabRect = QRect(x, y, width, height);
     SpectacleConfig::instance()->setCropRegion(d->mGrabRect);
 
-    QQuickItem *target = d->mQuickView->rootObject()->findChild<QQuickItem *>(QStringLiteral("imageBackground"));
-    d->mCurrentGrabResult = target->grabToImage();
-    if (d->mCurrentGrabResult.isNull()) {
-        emit grabCancelled();
-        return;
-    }
-
-    connect(d->mCurrentGrabResult.data(), &QQuickItemGrabResult::ready, this, &QuickEditor::grabReadyHandler);
+    d->mQuickView->hide();
+    emit grabDone(mImageStore->mPixmap.copy(d->mGrabRect), d->mGrabRect);
 }
 
-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);
-}
-

--- a/src/QuickEditor/QuickEditor.h
+++ b/src/QuickEditor/QuickEditor.h
@@ -39,7 +39,6 @@
     private slots:
 
     void acceptImageHandler(int x, int y, int width, int height);
-    void grabReadyHandler();
 
     private: