Commit 54313d32 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

effects/magnifier: Schedule a repaint when window is damaged

This is needed to make per-screen rendering work correctly.

BUG: 431652
parent 35e254a8
......@@ -58,6 +58,7 @@ MagnifierEffect::MagnifierEffect()
effects->registerGlobalShortcut(Qt::META + Qt::Key_0, a);
connect(effects, &EffectsHandler::mouseChanged, this, &MagnifierEffect::slotMouseChanged);
connect(effects, &EffectsHandler::windowDamaged, this, &MagnifierEffect::slotWindowDamaged);
reconfigure(ReconfigureAll);
}
......@@ -332,6 +333,13 @@ void MagnifierEffect::slotMouseChanged(const QPoint& pos, const QPoint& old,
effects->addRepaintFull();
}
void MagnifierEffect::slotWindowDamaged()
{
if (isActive()) {
effects->addRepaint(magnifierArea());
}
}
bool MagnifierEffect::isActive() const
{
return zoom != 1.0 || zoom != target_zoom;
......
......@@ -50,6 +50,7 @@ private Q_SLOTS:
void slotMouseChanged(const QPoint& pos, const QPoint& old,
Qt::MouseButtons buttons, Qt::MouseButtons oldbuttons,
Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers);
void slotWindowDamaged();
void destroyPixmap();
private:
QRect magnifierArea(QPoint pos = cursorPos()) const;
......
Markdown is supported
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