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.
This commit is contained in:
Vlad Zahorodnii 2022-02-17 12:07:19 +02:00
parent 6d20b977ab
commit ae3dc3f3c6
2 changed files with 1 additions and 9 deletions

View file

@ -52,13 +52,7 @@ ColorPickerEffect::~ColorPickerEffect() = default;
void ColorPickerEffect::paintScreen(int mask, const QRegion &region, 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];

View file

@ -27,11 +27,10 @@ public:
ColorPickerEffect();
~ColorPickerEffect() override;
void paintScreen(int mask, const QRegion &region, 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;
};