From ae3dc3f3c6e7bfab858e55109bf4eb984f0a03e9 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 17 Feb 2022 12:07:19 +0200 Subject: [PATCH] effects/colorpicker: Pick color in paintScreen() It's not guaranteed that there will be current render target in postPaintScreen() as all painting have been completed. paintScreen() is a much safer place to pick color. --- src/effects/colorpicker/colorpicker.cpp | 6 ------ src/effects/colorpicker/colorpicker.h | 4 +--- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/effects/colorpicker/colorpicker.cpp b/src/effects/colorpicker/colorpicker.cpp index 088f68ed9d..fcd19008ce 100644 --- a/src/effects/colorpicker/colorpicker.cpp +++ b/src/effects/colorpicker/colorpicker.cpp @@ -52,13 +52,7 @@ ColorPickerEffect::~ColorPickerEffect() = default; void ColorPickerEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) { - m_paintedScreen = data.screen(); effects->paintScreen(mask, region, data); -} - -void ColorPickerEffect::postPaintScreen() -{ - effects->postPaintScreen(); if (m_scheduledPosition != QPoint(-1, -1) && effects->renderTargetRect().contains(m_scheduledPosition)) { uint8_t data[3]; diff --git a/src/effects/colorpicker/colorpicker.h b/src/effects/colorpicker/colorpicker.h index 1be048d74b..2f6f73c40a 100644 --- a/src/effects/colorpicker/colorpicker.h +++ b/src/effects/colorpicker/colorpicker.h @@ -27,11 +27,10 @@ public: ColorPickerEffect(); ~ColorPickerEffect() override; void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override; - void postPaintScreen() override; bool isActive() const override; int requestedEffectChainPosition() const override { - return 50; + return 0; } static bool supported(); @@ -44,7 +43,6 @@ private: void hideInfoMessage(); QDBusMessage m_replyMessage; - EffectScreen *m_paintedScreen = nullptr; QPoint m_scheduledPosition; bool m_picking = false; };