effects: Make effects responsible for handling skipsCloseAnimation flag

This allows to make painting code more generic.
This commit is contained in:
Vlad Zahorodnii 2021-09-01 19:22:21 +03:00
parent 701902fbec
commit 6851996eb2
6 changed files with 5 additions and 9 deletions

View file

@ -82,7 +82,7 @@ class FadeEffect {
if (effects.hasActiveFullScreenEffect) {
return;
}
if (!this.fadeWindows || !FadeEffect.isFadeWindow(window)) {
if (!this.fadeWindows || window.skipsCloseAnimation || !FadeEffect.isFadeWindow(window)) {
return;
}
window.fadeOutAnimation = animate({

View file

@ -99,7 +99,7 @@ var fadingPopupsEffect = {
if (!isPopupWindow(window)) {
return;
}
if (!window.visible) {
if (!window.visible || window.skipsCloseAnimation) {
return;
}
if (!effect.grab(window, Effect.WindowClosedGrabRole)) {

View file

@ -237,7 +237,7 @@ void GlideEffect::windowClosed(EffectWindow *w)
return;
}
if (!w->isVisible()) {
if (!w->isVisible() || w->skipsCloseAnimation()) {
return;
}

View file

@ -126,7 +126,7 @@ class ScaleEffect {
if (!ScaleEffect.isScaleWindow(window)) {
return;
}
if (!window.visible) {
if (!window.visible || window.skipsCloseAnimation) {
return;
}
if (!effect.grab(window, Effect.WindowClosedGrabRole)) {

View file

@ -182,7 +182,7 @@ void SheetEffect::slotWindowClosed(EffectWindow *w)
return;
}
if (!isSheetWindow(w)) {
if (!isSheetWindow(w) || w->skipsCloseAnimation()) {
return;
}

View file

@ -511,10 +511,6 @@ void Scene::paintWindow(Window* w, int mask, const QRegion &_region)
const QRegion region = _region & QRect({0, 0}, screens()->size());
if (region.isEmpty()) // completely clipped
return;
if (w->window()->isDeleted() && w->window()->skipsCloseAnimation()) {
// should not get painted
return;
}
WindowPaintData data(w->window()->effectWindow(), screenProjectionMatrix());
effects->paintWindow(effectWindow(w), mask, region, data);