[effects/slide] Completely delete forced roles
ClosedPublic

Authored by zzag on Jun 10 2018, 8:45 PM.

Details

Summary

The slide effect doesn't completely remove forced blur and background
contrast roles. According to EffectWindow::setData implementation,

void EffectWindowImpl::setData(int role, const QVariant &data)
{
    if (!data.isNull())
        dataMap[ role ] = data;
    else
        dataMap.remove(role);
    emit effects->windowDataChanged(this, role);
}

in order to delete previously set data, we should pass a null variant.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
zzag created this revision.Jun 10 2018, 8:45 PM
Restricted Application added a project: KWin. · View Herald TranscriptJun 10 2018, 8:45 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Jun 10 2018, 8:45 PM
zzag added a comment.Jun 10 2018, 8:47 PM
This comment was removed by zzag.
davidedmundson accepted this revision.Jun 11 2018, 9:51 AM
davidedmundson added a subscriber: davidedmundson.

Heh, it made me find a bug (D13478)

As for this.
It's storing a correct value vs deleting the value because you know that value happens to be considerered the default.

Not worse, but it's not exactly solving anything either.

Note presentwindows has the same setData(...,false);

This revision is now accepted and ready to land.Jun 11 2018, 9:51 AM
zzag added a comment.Jun 11 2018, 10:11 AM

It's storing a correct value vs deleting the value because you know that value happens to be considerered the default.
Not worse, but it's not exactly solving anything either.

Agree, it doesn't fix anything, that's to cleanup after itself. Slide effect set force roles before so it should delete them. (yet, I'm still in between refcounting force roles and blindly setting/deleting force roles)

zzag added a comment.Jun 11 2018, 10:14 AM

Either way, storing previous values of force roles is error-prone.

Either way, storing previous values of force roles is error-prone.

Completely agree on that part.

This revision was automatically updated to reflect the committed changes.