Runner/Windows make the window finding more reliable

Authored by meven on Jan 22 2020, 4:41 PM.

Description

Runner/Windows make the window finding more reliable

Summary:
QTimer::singleShot could dispatch gatherInfo after the next WindowsRunner::match was called in a not-ready state preventing to return match.

prepareForMatchSession will lock the lock, allowing only gatherInfo to run, which will unlock the lock, allowing match() to run.

BUG: 414804
FIXED-IN: 5.18

Reviewers: Plasma, ngraham, mart, davidedmundson

Subscribers: plasma-devel

Tags: Plasma

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