[effects/sheet] Drop IsSheetWindow hack
ClosedPublic

Authored by zzag on Jul 20 2018, 10:21 AM.

Details

Summary

When the Sheet effect was written, isModal worked only for Client
windows, not Deleted windows:

bool EffectWindowImpl::isModal() const
    {
    if( Client* c = dynamic_cast< Client* >( toplevel ))
        return c->isModal();
    return false;
    }

so the Sheet effect had to track windows by using WindowInfo class, e.g.

class WindowInfo
    {
    public:
        bool deleted;
        bool added;
        bool closed;
    };

the biggest drawback of that method is that WindowInfo for each modal kept around
as long as those modals existed. It also was adding little overhead, e.g.

void SheetEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data )
    {
    if( windows.contains( w ) && ( windows[ w ].added || windows[ w ].closed ) )

Things changed with a8160b3c31afa1db24084147ad4ce50cf3c0314a. With that
commit, WindowInfo kept only for modals that are currently being
animated, but isModal still worked only with Client windows, so
IsSheetWindow hack had been introduced.

Long story short: we don't need IsSheetWindow hack anymore because
isModal now works with Deleted windows.

Test Plan

Pressed Ctrl+O in Kate.

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.Jul 20 2018, 10:21 AM
Restricted Application added a project: KWin. · View Herald TranscriptJul 20 2018, 10:21 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Jul 20 2018, 10:21 AM
davidedmundson accepted this revision.Jul 20 2018, 10:44 AM
This revision is now accepted and ready to land.Jul 20 2018, 10:44 AM
This revision was automatically updated to reflect the committed changes.