[Window Thumbnail] Also monitor scene visibility and clean up
ClosedPublic

Authored by broulik on Thu, Apr 25, 10:44 AM.

Details

Summary

Just because the item is visible doesn't mean the window itself is. Keep track of the window it's in.
Use itemChange instead of connects and move the check for starting to startRedirect so we don't have to check the conditions for that in every change handler (visible && enabled && window->visible). It also saves three connects in the constructor.
Also, don't unredirect if we didn't redirect in the first place to avoid warnings printed on console.

BUG: 406303

Test Plan

Window thumbnails still work
Don't have fds pile up anymore

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Thu, Apr 25, 10:44 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptThu, Apr 25, 10:44 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Thu, Apr 25, 10:44 AM

I recall there was also a bug about "games becoming slow when hovering them in task bar" which might be the same bug: us not unredirecting it again

davidedmundson accepted this revision.Thu, Apr 25, 12:24 PM
This revision is now accepted and ready to land.Thu, Apr 25, 12:24 PM
This revision was automatically updated to reflect the committed changes.
zzag added a subscriber: zzag.Thu, Apr 25, 1:05 PM
zzag added inline comments.
src/declarativeimports/core/windowthumbnail.cpp
213

Do you actually need Q_FALLTHROUGH() here?

broulik added inline comments.Thu, Apr 25, 1:06 PM
src/declarativeimports/core/windowthumbnail.cpp
213

I fall through so I wanted to make it explicit. I would have put a // fallthrough comment otherwise