Commit e41c5af6 authored by Niccolò Venerandi's avatar Niccolò Venerandi
Browse files

Expose transientFor and only blur underneath when transientParent is dock

parent d4cd2b5a
......@@ -46,6 +46,7 @@ public:
void addLayerRepaint(const QRect &r) override;
void addLayerRepaint(int x, int y, int w, int h) override;
EffectWindow *findModal() override;
EffectWindow *transientFor() override;
const EffectWindowGroup *group() const override;
bool isPaintingEnabled() override;
EffectWindowList mainWindows() const override;
......@@ -340,6 +341,11 @@ EffectWindow *MockEffectWindow::findModal()
return nullptr;
}
EffectWindow *MockEffectWindow::transientFor()
{
return nullptr;
}
const EffectWindowGroup *MockEffectWindow::group() const
{
return nullptr;
......
......@@ -1984,6 +1984,21 @@ EffectWindow* EffectWindowImpl::findModal()
return nullptr;
}
EffectWindow* EffectWindowImpl::transientFor()
{
auto client = qobject_cast<AbstractClient *>(toplevel);
if (!client) {
return nullptr;
}
AbstractClient *transientFor = client->transientFor();
if (transientFor) {
return transientFor->effectWindow();
}
return nullptr;
}
QWindow *EffectWindowImpl::internalWindow() const
{
auto client = qobject_cast<InternalClient *>(toplevel);
......
......@@ -471,6 +471,7 @@ public:
void deleteProperty(long atom) const override;
EffectWindow* findModal() override;
EffectWindow* transientFor() override;
EffectWindowList mainWindows() const override;
WindowQuadList buildQuads(bool force = false) const override;
......
......@@ -604,9 +604,12 @@ void BlurEffect::drawWindow(EffectWindow *w, int mask, const QRegion &region, Wi
shape = shape.translated(data.xTranslation(), data.yTranslation());
shape = shape & region;
}
EffectWindow* modal = w->transientFor();
const bool transientForIsDock = (modal ? modal->isDock() : false);
if (!shape.isEmpty()) {
doBlur(shape, screen, data.opacity(), data.screenProjectionMatrix(), w->isDock(), w->geometry());
doBlur(shape, screen, data.opacity(), data.screenProjectionMatrix(), w->isDock() || transientForIsDock, w->geometry());
}
}
......
......@@ -2373,6 +2373,7 @@ public:
virtual bool isModal() const = 0;
Q_SCRIPTABLE virtual KWin::EffectWindow* findModal() = 0;
Q_SCRIPTABLE virtual KWin::EffectWindow* transientFor() = 0;
Q_SCRIPTABLE virtual QList<KWin::EffectWindow*> mainWindows() const = 0;
/**
......
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