Commit ae3dc3f3 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

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.
parent 6d20b977
Pipeline #140574 passed with stage
in 17 minutes and 47 seconds
......@@ -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];
......
......@@ -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;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment