[Window Thumbnail] Also monitor scene visibility and clean up

Authored by broulik on Apr 25 2019, 1:01 PM.

Description

[Window Thumbnail] Also monitor scene visibility and clean up

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

Differential Revision: https://phabricator.kde.org/D20805

Details