From 2f6f59f6a0a8c91f00fc5ea0530125346cf6650d Mon Sep 17 00:00:00 2001
From: Alessandro Portale <alessandro.portale@qt.io>
Date: Tue, 22 Oct 2019 00:07:16 +0200
Subject: [PATCH] pixeltool: Pick color under cursor also outside of the
 pixeltool window

We want to pick color directly from the whole screen

Change-Id: Ifc845b1303203db54c657dac6fa02ba841b97fcc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
---
 src/pixeltool/qpixeltool.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/pixeltool/qpixeltool.cpp b/src/pixeltool/qpixeltool.cpp
index e03c0b514..f699ec828 100644
--- a/src/pixeltool/qpixeltool.cpp
+++ b/src/pixeltool/qpixeltool.cpp
@@ -553,6 +553,7 @@ void QPixelTool::grabScreen()
 
     update();
 
+    m_currentColor = m_buffer.toImage().pixel(m_buffer.rect().center());
     m_lastMousePos = mousePos;
 }
 
-- 
GitLab